結果

問題 No.1013 〇マス進む
ユーザー H3PO4H3PO4
提出日時 2021-08-25 09:54:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 466 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 151,464 KB
最終ジャッジ日時 2024-04-27 21:27:10
合計ジャッジ時間 51,411 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 38 ms
10,752 KB
testcase_06 AC 33 ms
10,752 KB
testcase_07 AC 36 ms
11,008 KB
testcase_08 AC 34 ms
10,752 KB
testcase_09 AC 35 ms
11,136 KB
testcase_10 AC 33 ms
10,880 KB
testcase_11 AC 34 ms
10,880 KB
testcase_12 AC 34 ms
10,752 KB
testcase_13 AC 65 ms
12,160 KB
testcase_14 AC 530 ms
31,608 KB
testcase_15 AC 816 ms
41,928 KB
testcase_16 AC 817 ms
41,800 KB
testcase_17 AC 458 ms
27,452 KB
testcase_18 AC 602 ms
32,912 KB
testcase_19 AC 280 ms
20,352 KB
testcase_20 AC 868 ms
41,508 KB
testcase_21 AC 435 ms
27,580 KB
testcase_22 AC 590 ms
31,900 KB
testcase_23 AC 177 ms
17,664 KB
testcase_24 AC 1,142 ms
53,840 KB
testcase_25 AC 1,062 ms
49,108 KB
testcase_26 AC 211 ms
18,432 KB
testcase_27 AC 355 ms
25,160 KB
testcase_28 AC 162 ms
16,512 KB
testcase_29 AC 876 ms
44,372 KB
testcase_30 AC 383 ms
24,788 KB
testcase_31 AC 682 ms
37,548 KB
testcase_32 AC 483 ms
30,720 KB
testcase_33 AC 1,230 ms
76,676 KB
testcase_34 AC 1,854 ms
105,104 KB
testcase_35 AC 1,963 ms
107,164 KB
testcase_36 AC 153 ms
17,024 KB
testcase_37 AC 151 ms
17,024 KB
testcase_38 TLE -
testcase_39 AC 724 ms
44,896 KB
testcase_40 TLE -
testcase_41 AC 524 ms
35,836 KB
testcase_42 AC 1,214 ms
69,240 KB
testcase_43 AC 720 ms
44,544 KB
testcase_44 AC 1,296 ms
77,416 KB
testcase_45 AC 1,115 ms
67,304 KB
testcase_46 AC 563 ms
38,400 KB
testcase_47 AC 1,029 ms
61,940 KB
testcase_48 AC 1,294 ms
76,756 KB
testcase_49 AC 1,989 ms
104,240 KB
testcase_50 AC 1,730 ms
99,224 KB
testcase_51 AC 1,419 ms
81,392 KB
testcase_52 AC 334 ms
25,984 KB
testcase_53 AC 450 ms
33,024 KB
testcase_54 AC 1,892 ms
111,060 KB
testcase_55 AC 602 ms
39,404 KB
testcase_56 TLE -
testcase_57 AC 1,807 ms
95,972 KB
testcase_58 TLE -
testcase_59 TLE -
testcase_60 TLE -
testcase_61 AC 851 ms
43,432 KB
testcase_62 AC 292 ms
20,668 KB
testcase_63 AC 29 ms
10,880 KB
testcase_64 AC 29 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
P = tuple(map(int, input().split()))
doubling = [[0] * N for _ in range(K.bit_length() + 1)]
for i, p in enumerate(P):
    doubling[0][i] = p
for j in range(K.bit_length()):
    for i in range(N):
        doubling[j + 1][i] = doubling[j][i] + doubling[j][(i + doubling[j][i]) % N]

for i in range(N):
    ans = i
    for j in range(K.bit_length()):
        if (K >> j) & 1:
            ans += doubling[j][ans % N]
    print(ans + 1)
0