結果

問題 No.1097 Remainder Operation
ユーザー 37zigen37zigen
提出日時 2020-06-27 06:00:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 396 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 34,988 KB
最終ジャッジ日時 2023-09-18 18:55:17
合計ジャッジ時間 7,179 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 15 ms
7,776 KB
testcase_02 AC 19 ms
8,152 KB
testcase_03 AC 19 ms
8,312 KB
testcase_04 AC 19 ms
8,288 KB
testcase_05 AC 18 ms
8,356 KB
testcase_06 AC 20 ms
8,348 KB
testcase_07 AC 452 ms
34,988 KB
testcase_08 AC 459 ms
34,784 KB
testcase_09 AC 467 ms
34,952 KB
testcase_10 AC 455 ms
34,904 KB
testcase_11 AC 482 ms
34,972 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
Q=int(input())
K=[int(input()) for i in range(Q)]
M=50
dp=[[-1]*M for i in range(N)]
for i in range(N):
    dp[i][0]=A[i%N]
for j in range(M-1):
    for i in range(N):
        middle=(dp[i][j]+i)%N
        dp[i][j+1]=dp[i][j]+dp[middle][j]

for k in K:
    X=0
    for i in range(M):
        if (k>>i)%2==1:
            X=X+dp[X%N][i]
    print(X)
0