The sanctuary floor is an N × M grid where each tile is sealed by a time lock.
Each tile contains a number representing the earliest time it can be entered.
You start at the top-left corner at time 0.
You may move in four directions, each move taking exactly one unit of time,
and you may wait in place for any amount of time.
You must reach the bottom-right corner as early as possible.
One grid where each cell gives the earliest time you are allowed to step on that cell.
1 ≤ n, m ≤ 300
0 ≤ aij ≤ 10^9
Output the minimum time to reach the destination, or -1 if it is impossible.
3 3 0 2 4 1 3 5 2 4 6
6
| 編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
|
沒有發現任何「解題報告」
|
|||||