結果

問題 No.1868 Teleporting Cyanmond
ユーザー pluto77pluto77
提出日時 2022-03-12 11:31:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 19,788 KB
最終ジャッジ日時 2023-10-14 23:36:47
合計ジャッジ時間 4,617 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,844 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 AC 14 ms
7,848 KB
testcase_03 AC 101 ms
17,228 KB
testcase_04 AC 76 ms
15,424 KB
testcase_05 AC 18 ms
8,520 KB
testcase_06 AC 28 ms
9,704 KB
testcase_07 AC 54 ms
12,588 KB
testcase_08 AC 40 ms
10,956 KB
testcase_09 AC 51 ms
12,344 KB
testcase_10 AC 87 ms
16,532 KB
testcase_11 AC 16 ms
8,272 KB
testcase_12 AC 35 ms
10,372 KB
testcase_13 AC 58 ms
13,580 KB
testcase_14 AC 101 ms
18,804 KB
testcase_15 AC 73 ms
14,956 KB
testcase_16 AC 24 ms
9,224 KB
testcase_17 AC 31 ms
10,164 KB
testcase_18 AC 108 ms
19,600 KB
testcase_19 AC 110 ms
19,788 KB
testcase_20 AC 109 ms
19,672 KB
testcase_21 AC 111 ms
19,540 KB
testcase_22 AC 110 ms
19,676 KB
testcase_23 AC 109 ms
19,660 KB
testcase_24 AC 108 ms
19,660 KB
testcase_25 AC 112 ms
19,624 KB
testcase_26 AC 111 ms
19,656 KB
testcase_27 AC 109 ms
19,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1868
INF=float('inf')
n=int(input())
r=list(map(int,input().split()))
x=0
res=[INF]*n
res[0]=0
for i in range(n-1):
 while x<r[i]:
  res[x]=min(res[x],res[i]+1)
  x+=1
print(res[-1])
0