結果
| 問題 |
No.1868 Teleporting Cyanmond
|
| コンテスト | |
| ユーザー |
ikoma
|
| 提出日時 | 2022-03-11 21:59:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 218 ms / 2,000 ms |
| コード長 | 300 bytes |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 82,508 KB |
| 実行使用メモリ | 90,624 KB |
| 最終ジャッジ日時 | 2024-09-16 02:13:41 |
| 合計ジャッジ時間 | 5,268 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
from heapq import *
N=int(input())
R=list(map(int,input().split()))
dist = [N]*N
dist[0] = 0
que = [(0,0)]
for i in range(N):
d,rr = que[0]
while i>rr:
heappop(que)
d,rr = que[0]
dist[i] = d
if i+1<N:
r = R[i]
heappush(que, (d+1,r-1))
print(dist[-1])
ikoma