結果

問題 No.1868 Teleporting Cyanmond
ユーザー 👑 SPD_9X2
提出日時 2022-03-11 21:24:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 81,024 KB
最終ジャッジ日時 2024-09-16 01:23:43
合計ジャッジ時間 2,835 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin

N = int(stdin.readline())

R = list(map(int,stdin.readline().split()))

for i in range(N-1):
    R[i] -= 1

last = 0
now = 0
ans = 0

while now < N-1:

    nex = 0
    for i in range(last,now+1):
        nex = max(nex , R[i])

    ans += 1
    now = nex
    last = now

print (ans)
0