結果

問題 No.1307 Rotate and Accumulate
ユーザー Kiri8128Kiri8128
提出日時 2020-12-04 02:13:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 351 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 146,100 KB
最終ジャッジ日時 2023-10-12 14:02:59
合計ジャッジ時間 43,380 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,292 KB
testcase_01 AC 71 ms
71,388 KB
testcase_02 AC 71 ms
71,016 KB
testcase_03 AC 70 ms
71,572 KB
testcase_04 AC 72 ms
71,328 KB
testcase_05 AC 74 ms
71,144 KB
testcase_06 AC 74 ms
71,324 KB
testcase_07 AC 71 ms
71,020 KB
testcase_08 AC 2,815 ms
113,220 KB
testcase_09 AC 3,077 ms
114,328 KB
testcase_10 AC 1,417 ms
101,836 KB
testcase_11 AC 2,426 ms
108,848 KB
testcase_12 AC 1,517 ms
103,016 KB
testcase_13 AC 128 ms
84,400 KB
testcase_14 AC 451 ms
87,892 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 365 ms
129,704 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 69 ms
71,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K = 28
f = lambda L: int("".join([bin(a + (1 << K))[3:] for a in L]), 2)
N, Q = map(int, input().split())
A = [int(a) for a in input().split()]
R = [int(a) for a in input().split()]
C = [0] * N
for r in R:
    C[r] += 1
S = bin(f(A) * f(C[::-1]) % ((1 << K * N) - 1) + (1 << K * N))[3:]
print(" ".join([str(int(S[i*K:(i+1)*K], 2)) for i in range(N)]))
0