結果

問題 No.1868 Teleporting Cyanmond
コンテスト
ユーザー kohei2019
提出日時 2023-08-14 19:16:24
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 271 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 318 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 86,016 KB
最終ジャッジ日時 2026-05-16 19:04:20
合計ジャッジ時間 2,655 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

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