結果

問題 No.1868 Teleporting Cyanmond
ユーザー nasutarou1341nasutarou1341
提出日時 2022-03-11 21:27:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 91,796 KB
最終ジャッジ日時 2023-10-14 06:14:45
合計ジャッジ時間 4,542 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,964 KB
testcase_01 AC 72 ms
71,192 KB
testcase_02 AC 69 ms
71,156 KB
testcase_03 AC 93 ms
89,560 KB
testcase_04 AC 87 ms
84,852 KB
testcase_05 AC 75 ms
76,076 KB
testcase_06 AC 77 ms
76,148 KB
testcase_07 AC 82 ms
81,500 KB
testcase_08 AC 78 ms
78,752 KB
testcase_09 AC 80 ms
80,372 KB
testcase_10 AC 91 ms
87,628 KB
testcase_11 AC 75 ms
76,200 KB
testcase_12 AC 78 ms
77,448 KB
testcase_13 AC 87 ms
81,480 KB
testcase_14 AC 96 ms
89,820 KB
testcase_15 AC 88 ms
84,976 KB
testcase_16 AC 78 ms
76,092 KB
testcase_17 AC 78 ms
77,328 KB
testcase_18 AC 99 ms
91,756 KB
testcase_19 AC 97 ms
91,480 KB
testcase_20 AC 98 ms
91,684 KB
testcase_21 AC 96 ms
91,736 KB
testcase_22 AC 95 ms
91,428 KB
testcase_23 AC 96 ms
91,700 KB
testcase_24 AC 98 ms
91,772 KB
testcase_25 AC 97 ms
91,796 KB
testcase_26 AC 99 ms
91,756 KB
testcase_27 AC 99 ms
91,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
R = list(map(int, input().split()))

S = [0] * (N - 1)
S[0] = R[0] 
for i in range(1, N - 1):
  S[i] = max(S[i - 1], R[i])
S = [0] + S

t = 1
cnt = 0
while t != N:
  t = S[t]
  cnt += 1

print(cnt)
0