結果

問題 No.1868 Teleporting Cyanmond
ユーザー tonyu0tonyu0
提出日時 2022-04-20 14:48:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 19,644 KB
最終ジャッジ日時 2023-09-02 08:55:20
合計ジャッジ時間 4,853 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 93 ms
17,376 KB
testcase_04 AC 76 ms
15,336 KB
testcase_05 AC 19 ms
8,644 KB
testcase_06 AC 29 ms
9,716 KB
testcase_07 AC 54 ms
12,616 KB
testcase_08 AC 39 ms
11,016 KB
testcase_09 AC 50 ms
12,156 KB
testcase_10 AC 87 ms
16,520 KB
testcase_11 AC 17 ms
8,352 KB
testcase_12 AC 34 ms
10,424 KB
testcase_13 AC 59 ms
13,148 KB
testcase_14 AC 100 ms
18,808 KB
testcase_15 AC 72 ms
14,840 KB
testcase_16 AC 25 ms
9,280 KB
testcase_17 AC 33 ms
10,316 KB
testcase_18 AC 113 ms
19,588 KB
testcase_19 AC 112 ms
19,532 KB
testcase_20 AC 112 ms
19,592 KB
testcase_21 AC 114 ms
19,524 KB
testcase_22 AC 113 ms
19,460 KB
testcase_23 AC 117 ms
19,500 KB
testcase_24 AC 118 ms
19,500 KB
testcase_25 AC 118 ms
19,500 KB
testcase_26 AC 116 ms
19,644 KB
testcase_27 AC 117 ms
19,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(lambda x:int(x)-1, input().split()))
b=a.copy()
for i in range(n-2):
    b[i+1]=max(b[i+1],b[i])
ans=0
cur=0
while cur + 1 != n:
    cur=b[cur]
    ans+=1
print(ans)
0