結果
| 問題 |
No.1868 Teleporting Cyanmond
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2022-03-11 23:03:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 270 bytes |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 82,432 KB |
| 最終ジャッジ日時 | 2024-09-16 03:25:50 |
| 合計ジャッジ時間 | 3,108 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
N = int(input())
R = list(map(int,input().split()))
cnt = 1
now = 0
next = 0
for i in range(N-1):
if i <= now:
next = max(next,R[i]-1)
else:
cnt += 1
now = next
next = max(next,R[i]-1)
if next == N -1:
break
print(cnt)
ntuda