結果

問題 No.1868 Teleporting Cyanmond
ユーザー NatsubiSoganNatsubiSogan
提出日時 2022-03-11 21:49:08
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 19,816 KB
最終ジャッジ日時 2023-10-14 06:54:55
合計ジャッジ時間 3,487 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,972 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 AC 101 ms
17,356 KB
testcase_04 AC 79 ms
15,440 KB
testcase_05 AC 20 ms
8,532 KB
testcase_06 AC 31 ms
9,784 KB
testcase_07 AC 57 ms
12,712 KB
testcase_08 AC 41 ms
11,172 KB
testcase_09 AC 53 ms
12,260 KB
testcase_10 AC 91 ms
16,412 KB
testcase_11 AC 17 ms
8,272 KB
testcase_12 AC 37 ms
10,372 KB
testcase_13 AC 60 ms
13,560 KB
testcase_14 AC 103 ms
18,928 KB
testcase_15 AC 76 ms
14,944 KB
testcase_16 AC 26 ms
9,212 KB
testcase_17 AC 34 ms
10,316 KB
testcase_18 AC 115 ms
19,604 KB
testcase_19 AC 114 ms
19,632 KB
testcase_20 AC 115 ms
19,764 KB
testcase_21 AC 114 ms
19,796 KB
testcase_22 AC 115 ms
19,688 KB
testcase_23 AC 119 ms
19,680 KB
testcase_24 AC 115 ms
19,784 KB
testcase_25 AC 117 ms
19,736 KB
testcase_26 AC 116 ms
19,816 KB
testcase_27 AC 117 ms
19,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
r = list(map(int, input().split()))
cur = 0
INF = 10 ** 9
ans = [INF] * n
ans[0] = 0
for i in range(n - 1):
    while cur < r[i]:
        ans[cur] = min(ans[cur], ans[i] + 1)
        cur += 1
print(ans[-1])
0