結果

問題 No.1307 Rotate and Accumulate
ユーザー trineutrontrineutron
提出日時 2020-12-04 00:47:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 411 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 47,344 KB
最終ジャッジ日時 2023-10-12 11:41:30
合計ジャッジ時間 7,174 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
29,412 KB
testcase_01 AC 133 ms
29,492 KB
testcase_02 AC 132 ms
29,388 KB
testcase_03 AC 131 ms
29,516 KB
testcase_04 AC 132 ms
29,356 KB
testcase_05 AC 129 ms
29,448 KB
testcase_06 AC 131 ms
29,380 KB
testcase_07 AC 133 ms
29,416 KB
testcase_08 AC 303 ms
47,344 KB
testcase_09 AC 317 ms
47,176 KB
testcase_10 AC 306 ms
42,580 KB
testcase_11 AC 245 ms
37,420 KB
testcase_12 AC 324 ms
43,664 KB
testcase_13 AC 196 ms
36,564 KB
testcase_14 AC 234 ms
37,240 KB
testcase_15 AC 400 ms
45,844 KB
testcase_16 AC 408 ms
45,924 KB
testcase_17 AC 411 ms
46,732 KB
testcase_18 AC 372 ms
41,396 KB
testcase_19 AC 404 ms
46,744 KB
testcase_20 AC 387 ms
45,880 KB
testcase_21 AC 135 ms
29,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as p
n,q=map(int,input().split())
a=p.array(list(map(int,input().split())))
b=p.zeros(n)
for i in map(int,input().split()):b[-i%n]+=1
print(*(p.fft.ifft(p.fft.fft(a)*p.fft.fft(b))+.5).astype(int))
0