結果

問題 No.1013 〇マス進む
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-23 13:06:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 117,108 KB
最終ジャッジ日時 2023-09-14 05:18:33
合計ジャッジ時間 15,807 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,148 KB
testcase_01 AC 74 ms
71,232 KB
testcase_02 AC 75 ms
71,192 KB
testcase_03 AC 87 ms
76,876 KB
testcase_04 AC 80 ms
76,300 KB
testcase_05 AC 86 ms
76,756 KB
testcase_06 AC 86 ms
76,920 KB
testcase_07 AC 87 ms
76,768 KB
testcase_08 AC 85 ms
76,656 KB
testcase_09 AC 87 ms
76,752 KB
testcase_10 AC 88 ms
76,632 KB
testcase_11 AC 87 ms
76,664 KB
testcase_12 AC 88 ms
76,816 KB
testcase_13 AC 92 ms
77,008 KB
testcase_14 AC 140 ms
95,388 KB
testcase_15 AC 183 ms
107,688 KB
testcase_16 AC 172 ms
104,408 KB
testcase_17 AC 135 ms
92,944 KB
testcase_18 AC 152 ms
96,704 KB
testcase_19 AC 124 ms
88,004 KB
testcase_20 AC 207 ms
115,276 KB
testcase_21 AC 131 ms
91,496 KB
testcase_22 AC 153 ms
97,368 KB
testcase_23 AC 103 ms
81,544 KB
testcase_24 AC 201 ms
116,056 KB
testcase_25 AC 203 ms
115,852 KB
testcase_26 AC 107 ms
81,656 KB
testcase_27 AC 125 ms
90,660 KB
testcase_28 AC 104 ms
81,776 KB
testcase_29 AC 194 ms
114,932 KB
testcase_30 AC 125 ms
88,956 KB
testcase_31 AC 159 ms
101,004 KB
testcase_32 AC 132 ms
94,776 KB
testcase_33 AC 149 ms
94,616 KB
testcase_34 AC 193 ms
106,452 KB
testcase_35 AC 191 ms
103,956 KB
testcase_36 AC 94 ms
76,960 KB
testcase_37 AC 92 ms
77,100 KB
testcase_38 AC 191 ms
108,648 KB
testcase_39 AC 124 ms
86,176 KB
testcase_40 AC 208 ms
106,080 KB
testcase_41 AC 108 ms
81,980 KB
testcase_42 AC 144 ms
93,524 KB
testcase_43 AC 122 ms
86,708 KB
testcase_44 AC 144 ms
94,832 KB
testcase_45 AC 138 ms
92,544 KB
testcase_46 AC 114 ms
82,624 KB
testcase_47 AC 145 ms
93,268 KB
testcase_48 AC 153 ms
97,192 KB
testcase_49 AC 211 ms
105,036 KB
testcase_50 AC 172 ms
101,092 KB
testcase_51 AC 163 ms
98,056 KB
testcase_52 AC 99 ms
77,096 KB
testcase_53 AC 110 ms
81,836 KB
testcase_54 AC 176 ms
103,712 KB
testcase_55 AC 117 ms
83,160 KB
testcase_56 AC 220 ms
111,420 KB
testcase_57 AC 188 ms
100,116 KB
testcase_58 AC 259 ms
116,688 KB
testcase_59 AC 250 ms
116,744 KB
testcase_60 AC 210 ms
116,976 KB
testcase_61 AC 199 ms
117,040 KB
testcase_62 AC 188 ms
117,108 KB
testcase_63 AC 74 ms
71,484 KB
testcase_64 AC 74 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
P = list(map(int, input().split()))

L = 32
D = [[0]*n for _ in range(L+1)]

for i, p in enumerate(P):
    D[0][i] = p

for i in range(L):
    for j in range(n):
        D[i+1][j] = D[i][j]+D[i][(j+D[i][j])%n]

for i in range(n):
    ans = i
    for bit in range(L):
        if k & (1 << bit):
            ans += D[bit][ans%n]
    print(ans+1)
0