結果
問題 | No.1868 Teleporting Cyanmond |
ユーザー |
|
提出日時 | 2022-03-13 07:02:55 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 213 bytes |
コンパイル時間 | 210 ms |
コンパイル使用メモリ | 81,968 KB |
実行使用メモリ | 89,216 KB |
最終ジャッジ日時 | 2024-09-17 16:19:57 |
合計ジャッジ時間 | 3,266 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 RE * 1 |
other | WA * 18 RE * 7 |
ソースコード
N = int(input())R = list(map(int, input().split()))dp = [float('inf')] * (N)dp[0] = 0s = 0g = R[s]while(1):dp[g-1] = min(dp[g-1], dp[s] + 1)if g == N:breaks = gg = R[s]dp[N-1]