結果

問題 No.1013 〇マス進む
ユーザー H3PO4H3PO4
提出日時 2021-08-25 09:55:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 116,576 KB
最終ジャッジ日時 2024-04-27 21:27:24
合計ジャッジ時間 9,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,712 KB
testcase_01 AC 33 ms
51,840 KB
testcase_02 AC 33 ms
51,968 KB
testcase_03 AC 46 ms
62,208 KB
testcase_04 AC 48 ms
61,592 KB
testcase_05 AC 45 ms
62,080 KB
testcase_06 AC 45 ms
62,464 KB
testcase_07 AC 45 ms
62,080 KB
testcase_08 AC 46 ms
62,080 KB
testcase_09 AC 47 ms
62,848 KB
testcase_10 AC 46 ms
62,336 KB
testcase_11 AC 46 ms
62,336 KB
testcase_12 AC 46 ms
62,848 KB
testcase_13 AC 51 ms
65,792 KB
testcase_14 AC 85 ms
86,780 KB
testcase_15 AC 102 ms
94,280 KB
testcase_16 AC 100 ms
92,788 KB
testcase_17 AC 85 ms
84,992 KB
testcase_18 AC 91 ms
88,104 KB
testcase_19 AC 74 ms
81,204 KB
testcase_20 AC 113 ms
97,792 KB
testcase_21 AC 84 ms
84,352 KB
testcase_22 AC 101 ms
88,064 KB
testcase_23 AC 65 ms
73,088 KB
testcase_24 AC 121 ms
100,532 KB
testcase_25 AC 121 ms
99,840 KB
testcase_26 AC 65 ms
73,076 KB
testcase_27 AC 77 ms
83,712 KB
testcase_28 AC 64 ms
73,344 KB
testcase_29 AC 114 ms
98,304 KB
testcase_30 AC 83 ms
82,560 KB
testcase_31 AC 98 ms
90,368 KB
testcase_32 AC 87 ms
86,528 KB
testcase_33 AC 108 ms
93,820 KB
testcase_34 AC 144 ms
103,868 KB
testcase_35 AC 150 ms
102,656 KB
testcase_36 AC 58 ms
67,200 KB
testcase_37 AC 57 ms
67,712 KB
testcase_38 AC 148 ms
106,624 KB
testcase_39 AC 87 ms
82,560 KB
testcase_40 AC 157 ms
104,756 KB
testcase_41 AC 73 ms
77,056 KB
testcase_42 AC 107 ms
91,936 KB
testcase_43 AC 91 ms
82,304 KB
testcase_44 AC 116 ms
93,824 KB
testcase_45 AC 105 ms
91,264 KB
testcase_46 AC 80 ms
77,824 KB
testcase_47 AC 105 ms
90,880 KB
testcase_48 AC 113 ms
94,976 KB
testcase_49 AC 150 ms
102,784 KB
testcase_50 AC 143 ms
100,096 KB
testcase_51 AC 125 ms
95,872 KB
testcase_52 AC 68 ms
71,680 KB
testcase_53 AC 77 ms
80,384 KB
testcase_54 AC 138 ms
103,284 KB
testcase_55 AC 81 ms
78,464 KB
testcase_56 AC 173 ms
110,976 KB
testcase_57 AC 145 ms
99,328 KB
testcase_58 AC 196 ms
115,456 KB
testcase_59 AC 182 ms
116,576 KB
testcase_60 AC 179 ms
116,480 KB
testcase_61 AC 119 ms
98,560 KB
testcase_62 AC 94 ms
93,696 KB
testcase_63 AC 35 ms
51,840 KB
testcase_64 AC 35 ms
52,224 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