r801. A. The Time-Locked Sanctuary
標籤 : Zaim
通過比率: 1人/ 2人 ( 50%) [非即時]
評分方式:
Tolerant

最近更新 : 2025-12-18 21:54

內容

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.

 

範例輸入 #1
3 3
0 2 4
1 3 5
2 4 6
範例輸出 #1
6
測資資訊:
記憶體限制: 129 MB
不公開 測資點#0 (10%): 1.0s , <1K
不公開 測資點#1 (10%): 1.0s , <1M
不公開 測資點#2 (10%): 1.0s , <1M
不公開 測資點#3 (10%): 1.0s , <1M
不公開 測資點#4 (10%): 1.0s , <1M
不公開 測資點#5 (10%): 1.0s , <1M
不公開 測資點#6 (10%): 1.0s , <1M
不公開 測資點#7 (10%): 1.0s , <1M
不公開 測資點#8 (10%): 1.0s , <1M
不公開 測資點#9 (10%): 1.0s , <1M
提示 :
標籤:
Zaim
出處:
[管理者: chenwei98050 ... (陳維(Z)) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」