結果
問題 | No.1868 Teleporting Cyanmond |
ユーザー |
|
提出日時 | 2023-08-14 19:16:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 271 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 82,816 KB |
実行使用メモリ | 86,272 KB |
最終ジャッジ日時 | 2024-11-22 19:13:41 |
合計ジャッジ時間 | 3,562 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
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)