結果
問題 | No.1868 Teleporting Cyanmond |
ユーザー | Theta |
提出日時 | 2022-10-26 17:12:32 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 110 ms / 2,000 ms |
コード長 | 583 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 10,704 KB |
実行使用メモリ | 25,356 KB |
最終ジャッジ日時 | 2023-09-17 10:29:34 |
合計ジャッジ時間 | 3,233 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
7,944 KB |
testcase_01 | AC | 16 ms
7,844 KB |
testcase_02 | AC | 16 ms
7,772 KB |
testcase_03 | AC | 55 ms
20,144 KB |
testcase_04 | AC | 46 ms
19,140 KB |
testcase_05 | AC | 17 ms
8,968 KB |
testcase_06 | AC | 23 ms
11,124 KB |
testcase_07 | AC | 35 ms
15,400 KB |
testcase_08 | AC | 29 ms
13,468 KB |
testcase_09 | AC | 34 ms
15,224 KB |
testcase_10 | AC | 53 ms
20,704 KB |
testcase_11 | AC | 16 ms
8,392 KB |
testcase_12 | AC | 26 ms
11,936 KB |
testcase_13 | AC | 42 ms
17,684 KB |
testcase_14 | AC | 70 ms
23,792 KB |
testcase_15 | AC | 51 ms
17,632 KB |
testcase_16 | AC | 21 ms
9,752 KB |
testcase_17 | AC | 26 ms
11,216 KB |
testcase_18 | AC | 93 ms
24,520 KB |
testcase_19 | AC | 92 ms
24,504 KB |
testcase_20 | AC | 90 ms
24,452 KB |
testcase_21 | AC | 91 ms
24,488 KB |
testcase_22 | AC | 92 ms
24,528 KB |
testcase_23 | AC | 110 ms
25,328 KB |
testcase_24 | AC | 109 ms
25,328 KB |
testcase_25 | AC | 109 ms
25,180 KB |
testcase_26 | AC | 109 ms
25,356 KB |
testcase_27 | AC | 108 ms
25,320 KB |
ソースコード
def main(): N = int(input()) R = list(map(int, input().split())) most_far_destination = 2 destination_reverse_dict = {} for idx, r in enumerate(R, 1): if r < most_far_destination: continue destination_reverse_dict.update( {dest: idx for dest in range(most_far_destination, r + 1)} ) most_far_destination = r + 1 destination = N ctr = 0 while destination != 1: destination = destination_reverse_dict[destination] ctr += 1 print(ctr) if __name__ == "__main__": main()