結果

問題 No.1307 Rotate and Accumulate
ユーザー trineutrontrineutron
提出日時 2020-12-04 00:23:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 399 ms / 5,000 ms
コード長 235 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 10,496 KB
実行使用メモリ 47,440 KB
最終ジャッジ日時 2023-10-12 10:58:56
合計ジャッジ時間 8,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
29,520 KB
testcase_01 AC 129 ms
29,552 KB
testcase_02 AC 130 ms
29,620 KB
testcase_03 AC 128 ms
29,596 KB
testcase_04 AC 129 ms
29,608 KB
testcase_05 AC 129 ms
29,620 KB
testcase_06 AC 128 ms
29,616 KB
testcase_07 AC 127 ms
29,604 KB
testcase_08 AC 300 ms
47,440 KB
testcase_09 AC 311 ms
47,248 KB
testcase_10 AC 312 ms
42,660 KB
testcase_11 AC 241 ms
37,792 KB
testcase_12 AC 319 ms
43,212 KB
testcase_13 AC 192 ms
36,356 KB
testcase_14 AC 227 ms
37,096 KB
testcase_15 AC 399 ms
45,800 KB
testcase_16 AC 396 ms
45,892 KB
testcase_17 AC 394 ms
45,808 KB
testcase_18 AC 378 ms
41,320 KB
testcase_19 AC 393 ms
46,652 KB
testcase_20 AC 397 ms
45,956 KB
testcase_21 AC 127 ms
29,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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