結果

問題 No.1013 〇マス進む
ユーザー roarisroaris
提出日時 2020-12-02 13:54:07
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 115,096 KB
最終ジャッジ日時 2023-10-11 11:23:17
合計ジャッジ時間 18,202 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,176 KB
testcase_01 AC 72 ms
71,612 KB
testcase_02 AC 74 ms
71,208 KB
testcase_03 AC 85 ms
76,880 KB
testcase_04 AC 80 ms
76,224 KB
testcase_05 AC 85 ms
77,180 KB
testcase_06 AC 87 ms
76,896 KB
testcase_07 AC 86 ms
76,736 KB
testcase_08 AC 85 ms
76,868 KB
testcase_09 AC 84 ms
76,960 KB
testcase_10 AC 86 ms
77,016 KB
testcase_11 AC 86 ms
76,908 KB
testcase_12 AC 86 ms
76,876 KB
testcase_13 AC 90 ms
77,032 KB
testcase_14 AC 135 ms
94,564 KB
testcase_15 AC 172 ms
106,172 KB
testcase_16 AC 163 ms
103,212 KB
testcase_17 AC 128 ms
92,244 KB
testcase_18 AC 143 ms
95,844 KB
testcase_19 AC 119 ms
87,568 KB
testcase_20 AC 194 ms
113,660 KB
testcase_21 AC 124 ms
90,452 KB
testcase_22 AC 143 ms
96,360 KB
testcase_23 AC 102 ms
81,760 KB
testcase_24 AC 193 ms
114,376 KB
testcase_25 AC 191 ms
113,812 KB
testcase_26 AC 103 ms
81,512 KB
testcase_27 AC 122 ms
90,164 KB
testcase_28 AC 104 ms
81,752 KB
testcase_29 AC 189 ms
113,036 KB
testcase_30 AC 129 ms
88,544 KB
testcase_31 AC 155 ms
99,632 KB
testcase_32 AC 130 ms
93,900 KB
testcase_33 AC 135 ms
93,904 KB
testcase_34 AC 181 ms
104,924 KB
testcase_35 AC 181 ms
102,800 KB
testcase_36 AC 94 ms
77,200 KB
testcase_37 AC 92 ms
77,100 KB
testcase_38 AC 183 ms
106,884 KB
testcase_39 AC 121 ms
85,800 KB
testcase_40 AC 199 ms
104,684 KB
testcase_41 AC 110 ms
82,000 KB
testcase_42 AC 139 ms
92,756 KB
testcase_43 AC 122 ms
86,452 KB
testcase_44 AC 143 ms
93,980 KB
testcase_45 AC 136 ms
91,908 KB
testcase_46 AC 110 ms
82,580 KB
testcase_47 AC 139 ms
92,616 KB
testcase_48 AC 148 ms
96,216 KB
testcase_49 AC 198 ms
103,632 KB
testcase_50 AC 165 ms
99,712 KB
testcase_51 AC 157 ms
96,960 KB
testcase_52 AC 98 ms
77,072 KB
testcase_53 AC 108 ms
81,692 KB
testcase_54 AC 161 ms
102,476 KB
testcase_55 AC 114 ms
82,868 KB
testcase_56 AC 206 ms
109,788 KB
testcase_57 AC 177 ms
98,968 KB
testcase_58 AC 248 ms
114,764 KB
testcase_59 AC 244 ms
115,096 KB
testcase_60 AC 210 ms
115,060 KB
testcase_61 AC 185 ms
115,088 KB
testcase_62 AC 178 ms
115,084 KB
testcase_63 AC 74 ms
71,468 KB
testcase_64 AC 74 ms
71,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
P = list(map(int, input().split()))
dp = [[-1]*N for _ in range(31)]

for i in range(N):
    dp[0][i] = P[i]

for i in range(1, 31):
    for j in range(N):
        dp[i][j] = dp[i-1][j]+dp[i-1][(j+dp[i-1][j])%N]

for i in range(N):
    k = K
    now = i
    
    for j in range(31):
        if k&1:
            now += dp[j][now%N]
        
        k >>= 1
    
    print(now+1)
0