結果

問題 No.1868 Teleporting Cyanmond
ユーザー ntudantuda
提出日時 2022-03-11 23:03:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 90,564 KB
最終ジャッジ日時 2023-10-14 08:18:51
合計ジャッジ時間 3,863 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,292 KB
testcase_01 AC 61 ms
71,316 KB
testcase_02 AC 64 ms
71,312 KB
testcase_03 AC 80 ms
88,200 KB
testcase_04 AC 71 ms
84,172 KB
testcase_05 AC 63 ms
75,896 KB
testcase_06 AC 64 ms
76,296 KB
testcase_07 AC 72 ms
80,852 KB
testcase_08 AC 68 ms
77,856 KB
testcase_09 AC 73 ms
80,376 KB
testcase_10 AC 79 ms
86,620 KB
testcase_11 AC 68 ms
76,184 KB
testcase_12 AC 68 ms
77,212 KB
testcase_13 AC 75 ms
81,312 KB
testcase_14 AC 85 ms
88,384 KB
testcase_15 AC 77 ms
84,188 KB
testcase_16 AC 66 ms
76,556 KB
testcase_17 AC 69 ms
77,080 KB
testcase_18 AC 84 ms
90,196 KB
testcase_19 AC 87 ms
90,352 KB
testcase_20 AC 89 ms
90,148 KB
testcase_21 AC 88 ms
90,384 KB
testcase_22 AC 85 ms
90,160 KB
testcase_23 AC 88 ms
90,408 KB
testcase_24 AC 87 ms
90,360 KB
testcase_25 AC 88 ms
90,280 KB
testcase_26 AC 89 ms
90,564 KB
testcase_27 AC 88 ms
90,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0