Prázdny
Prázdny

Task 4 was revealed 30.10.2025 at 18:00 CET

Login required

*

Task: Midnight Spirits

Story:

 

"Midnight spirits."

 

At midnight, the spirits appeared in the streets, their pale shapes drifting through the shadows.

Domi knew he had to find a way home—one that kept him as far from danger as possible.

 

************

Task:

 

The map to Domi's home is represented by a maze of cells, where each cell has a numeric value indicating the danger level of the cell.

 

You must find the safest path (i.e., the one with the lowest total danger value) from the top-left corner to the bottom-right corner of the matrix.

 

In this challenge, you can only move right or down (you cannot move back or diagonally), and you must calculate the total danger level of the safest path.

 

The map is represented by an n x m matrix where each cell is a positive number representing the danger level of that cell on the map.

 

And you have to return the total danger value of the safest path from the top-left corner (position [0][0]) to the bottom-right corner (position [n-1][m-1]) and the safest path coordinations.

 

************

Example:

Input:

 

map = [

[1, 3, 1],

[1, 5, 1],

  [4, 2, 1],

]

 

Output:

7

[0, 0]

[0, 1]

[0, 2]

[1, 2]

[2, 2]

 

************

Your task:

Read input file and into the field with the answer, enter :

  • The resulting values for each case according output in example
  • At the end paste the source code of your program.

Input file:

Click HERE to download the input file.

 

Answer:

ClickHERE to download the answer.

Points for

Correct answer

Source Code

 

Bonus points for

Quick and correct answer

Round 4

4

1

 

Round 4

8

7

6

5

4

3

2

1

Correct answer:

Total danger value of the safest path : 0,2 points

Safest path coordinations : 0,3 points

----------

Total for every case : 0,5 points