結果

問題 No.1307 Rotate and Accumulate
ユーザー trineutrontrineutron
提出日時 2020-12-04 00:20:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 407 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 47,428 KB
最終ジャッジ日時 2023-10-12 10:55:41
合計ジャッジ時間 8,992 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
29,616 KB
testcase_01 AC 128 ms
29,524 KB
testcase_02 AC 127 ms
29,440 KB
testcase_03 AC 128 ms
29,524 KB
testcase_04 AC 130 ms
29,496 KB
testcase_05 AC 130 ms
29,628 KB
testcase_06 AC 128 ms
29,564 KB
testcase_07 AC 127 ms
29,600 KB
testcase_08 AC 314 ms
47,428 KB
testcase_09 AC 310 ms
47,212 KB
testcase_10 AC 302 ms
42,628 KB
testcase_11 AC 242 ms
37,832 KB
testcase_12 AC 321 ms
43,132 KB
testcase_13 AC 197 ms
36,632 KB
testcase_14 AC 220 ms
37,272 KB
testcase_15 AC 392 ms
45,824 KB
testcase_16 AC 397 ms
46,008 KB
testcase_17 AC 407 ms
46,752 KB
testcase_18 AC 372 ms
41,292 KB
testcase_19 AC 390 ms
46,436 KB
testcase_20 AC 391 ms
45,804 KB
testcase_21 AC 128 ms
29,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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