結果

問題 No.1868 Teleporting Cyanmond
ユーザー kohei2019
提出日時 2023-08-14 19:00:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 258 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 84,736 KB
最終ジャッジ日時 2024-11-22 18:50:19
合計ジャッジ時間 3,678 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsR = list(map(lambda x:int(x)-1,input().split()))

now = 0
nextto = lsR[now]
cnt = 0
while True:
    if now == N-1:
        break
    for j in range(now,nextto):
        nextto = max(nextto,lsR[j])
    now = lsR[now]
    cnt += 1
print(cnt)
0