結果
| 問題 |
No.1868 Teleporting Cyanmond
|
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2022-03-11 21:28:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 338 bytes |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 82,056 KB |
| 実行使用メモリ | 98,708 KB |
| 最終ジャッジ日時 | 2024-09-16 01:31:15 |
| 合計ジャッジ時間 | 3,897 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 24 |
ソースコード
from collections import deque n = int(input()) r = list(map(int,input().split())) tansaku = [0] * n dp = [0] * n mada = deque([0]) tmp = 0 while mada: i = mada.popleft() if i < n-1: for j in range(max(tmp, i+1), r[i]): if tansaku[j] == 0: tansaku[j] = 1 mada.append(j) dp[j] = dp[i] + 1 tmp = r[i] print(dp[n-1])
shobonvip