結果

問題 No.1868 Teleporting Cyanmond
ユーザー lllllll88938494lllllll88938494
提出日時 2022-06-04 02:32:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 82,732 KB
最終ジャッジ日時 2023-10-21 02:32:56
合計ジャッジ時間 4,062 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,420 KB
testcase_01 AC 40 ms
53,420 KB
testcase_02 AC 36 ms
53,420 KB
testcase_03 AC 101 ms
78,684 KB
testcase_04 AC 53 ms
72,284 KB
testcase_05 AC 42 ms
59,976 KB
testcase_06 AC 44 ms
62,024 KB
testcase_07 AC 48 ms
69,008 KB
testcase_08 AC 45 ms
66,312 KB
testcase_09 AC 48 ms
68,212 KB
testcase_10 AC 54 ms
77,056 KB
testcase_11 AC 40 ms
59,976 KB
testcase_12 AC 46 ms
63,104 KB
testcase_13 AC 51 ms
69,072 KB
testcase_14 AC 59 ms
78,864 KB
testcase_15 AC 54 ms
74,200 KB
testcase_16 AC 47 ms
62,032 KB
testcase_17 AC 45 ms
64,800 KB
testcase_18 AC 64 ms
82,732 KB
testcase_19 AC 63 ms
82,732 KB
testcase_20 AC 64 ms
82,732 KB
testcase_21 AC 63 ms
82,732 KB
testcase_22 AC 64 ms
82,732 KB
testcase_23 AC 62 ms
82,732 KB
testcase_24 AC 61 ms
82,732 KB
testcase_25 AC 61 ms
82,732 KB
testcase_26 AC 62 ms
82,732 KB
testcase_27 AC 61 ms
82,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ns=list(map(int,input().split()))
m=[0]*(n-1)
ma=0
for i in range(n-1):
    ma=max(ns[i],ma)
    m[i] = ma
    
now=m[0]
cnt=1
while now != n:
    now = m[now-1]
    cnt+=1
print(cnt)
0