結果

問題 No.1868 Teleporting Cyanmond
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-03-11 21:40:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 91,532 KB
最終ジャッジ日時 2023-10-14 06:37:47
合計ジャッジ時間 4,269 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
70,940 KB
testcase_01 AC 74 ms
71,388 KB
testcase_02 AC 74 ms
71,468 KB
testcase_03 AC 97 ms
88,660 KB
testcase_04 AC 89 ms
84,496 KB
testcase_05 AC 82 ms
76,308 KB
testcase_06 AC 81 ms
76,160 KB
testcase_07 AC 86 ms
81,308 KB
testcase_08 AC 85 ms
78,540 KB
testcase_09 AC 86 ms
80,392 KB
testcase_10 AC 95 ms
87,272 KB
testcase_11 AC 83 ms
76,320 KB
testcase_12 AC 83 ms
77,412 KB
testcase_13 AC 94 ms
81,480 KB
testcase_14 AC 101 ms
89,164 KB
testcase_15 AC 94 ms
84,608 KB
testcase_16 AC 85 ms
76,532 KB
testcase_17 AC 85 ms
77,172 KB
testcase_18 AC 106 ms
91,104 KB
testcase_19 AC 105 ms
91,080 KB
testcase_20 AC 106 ms
91,276 KB
testcase_21 AC 102 ms
91,000 KB
testcase_22 AC 107 ms
91,192 KB
testcase_23 AC 111 ms
91,532 KB
testcase_24 AC 110 ms
91,056 KB
testcase_25 AC 107 ms
91,108 KB
testcase_26 AC 110 ms
91,020 KB
testcase_27 AC 109 ms
91,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
r = list(map(int,input().split()))
idx = [0] * n
flg = 1
for i in range(n-1):
    if r[i] > flg :
        for j in range(flg,r[i]):
            idx[j] = i
        flg = r[i]
k = idx[n-1]
ans = 1
while k:
    k = idx[k]
    ans += 1
print(ans)
0