結果

問題 No.1013 〇マス進む
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-31 23:22:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 113,280 KB
最終ジャッジ日時 2024-04-28 21:03:11
合計ジャッジ時間 11,561 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 37 ms
51,840 KB
testcase_03 AC 50 ms
62,720 KB
testcase_04 AC 46 ms
60,416 KB
testcase_05 AC 49 ms
62,464 KB
testcase_06 AC 50 ms
62,464 KB
testcase_07 AC 50 ms
62,976 KB
testcase_08 AC 50 ms
62,720 KB
testcase_09 AC 50 ms
62,720 KB
testcase_10 AC 51 ms
62,592 KB
testcase_11 AC 51 ms
62,848 KB
testcase_12 AC 49 ms
62,976 KB
testcase_13 AC 56 ms
65,792 KB
testcase_14 AC 109 ms
93,056 KB
testcase_15 AC 142 ms
104,576 KB
testcase_16 AC 139 ms
101,888 KB
testcase_17 AC 99 ms
90,368 KB
testcase_18 AC 117 ms
94,464 KB
testcase_19 AC 88 ms
84,096 KB
testcase_20 AC 170 ms
111,744 KB
testcase_21 AC 99 ms
88,832 KB
testcase_22 AC 114 ms
94,592 KB
testcase_23 AC 68 ms
74,240 KB
testcase_24 AC 172 ms
112,896 KB
testcase_25 AC 160 ms
112,000 KB
testcase_26 AC 71 ms
75,136 KB
testcase_27 AC 91 ms
88,704 KB
testcase_28 AC 69 ms
74,624 KB
testcase_29 AC 155 ms
111,360 KB
testcase_30 AC 94 ms
87,040 KB
testcase_31 AC 127 ms
98,048 KB
testcase_32 AC 109 ms
92,288 KB
testcase_33 AC 113 ms
92,160 KB
testcase_34 AC 146 ms
103,436 KB
testcase_35 AC 151 ms
100,992 KB
testcase_36 AC 58 ms
66,944 KB
testcase_37 AC 56 ms
66,944 KB
testcase_38 AC 152 ms
105,344 KB
testcase_39 AC 83 ms
81,920 KB
testcase_40 AC 164 ms
103,168 KB
testcase_41 AC 74 ms
75,776 KB
testcase_42 AC 108 ms
91,008 KB
testcase_43 AC 90 ms
82,432 KB
testcase_44 AC 110 ms
92,672 KB
testcase_45 AC 104 ms
90,368 KB
testcase_46 AC 80 ms
77,312 KB
testcase_47 AC 104 ms
90,880 KB
testcase_48 AC 119 ms
94,464 KB
testcase_49 AC 160 ms
102,016 KB
testcase_50 AC 132 ms
97,792 KB
testcase_51 AC 125 ms
95,232 KB
testcase_52 AC 63 ms
71,296 KB
testcase_53 AC 68 ms
74,752 KB
testcase_54 AC 138 ms
100,608 KB
testcase_55 AC 78 ms
77,824 KB
testcase_56 AC 169 ms
108,288 KB
testcase_57 AC 143 ms
97,664 KB
testcase_58 AC 201 ms
113,280 KB
testcase_59 AC 187 ms
113,152 KB
testcase_60 AC 189 ms
113,280 KB
testcase_61 AC 161 ms
113,152 KB
testcase_62 AC 153 ms
113,152 KB
testcase_63 AC 36 ms
51,712 KB
testcase_64 AC 37 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
P = list(map(int,input().split()))
doubling = [[0]*n for i in range(30)]
for i in range(n):
    doubling[0][i] = P[i]

for i in range(1,30):
    for j in range(n):
        doubling[i][j] = doubling[i-1][j] + doubling[i-1][(doubling[i-1][j]+j)%n]

for i in range(n):
    ans = i+1
    now = i
    nk = k
    for j in range(30)[::-1]:
        if nk >= 1<<j:
            nk -= 1<<j
            ans += doubling[j][now]
            now = (now+doubling[j][now])%n
    print(ans)
0