結果

問題 No.1307 Rotate and Accumulate
ユーザー trineutrontrineutron
提出日時 2020-12-04 00:41:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 405 ms / 5,000 ms
コード長 214 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 10,500 KB
実行使用メモリ 47,072 KB
最終ジャッジ日時 2023-10-12 11:27:17
合計ジャッジ時間 7,296 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
28,884 KB
testcase_01 AC 129 ms
29,160 KB
testcase_02 AC 128 ms
29,060 KB
testcase_03 AC 127 ms
29,028 KB
testcase_04 AC 130 ms
28,856 KB
testcase_05 AC 130 ms
29,164 KB
testcase_06 AC 130 ms
28,696 KB
testcase_07 AC 128 ms
28,964 KB
testcase_08 AC 293 ms
47,072 KB
testcase_09 AC 314 ms
46,884 KB
testcase_10 AC 307 ms
42,016 KB
testcase_11 AC 243 ms
37,088 KB
testcase_12 AC 320 ms
43,144 KB
testcase_13 AC 192 ms
36,272 KB
testcase_14 AC 226 ms
36,712 KB
testcase_15 AC 399 ms
45,640 KB
testcase_16 AC 405 ms
46,348 KB
testcase_17 AC 403 ms
46,424 KB
testcase_18 AC 370 ms
40,928 KB
testcase_19 AC 391 ms
46,392 KB
testcase_20 AC 386 ms
45,628 KB
testcase_21 AC 129 ms
28,960 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.array(p.fft.ifft(p.fft.fft(a)*p.fft.fft(b))+.5,dtype=int))
0