結果

問題 No.1307 Rotate and Accumulate
ユーザー trineutrontrineutron
提出日時 2020-12-04 00:52:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 400 ms / 5,000 ms
コード長 206 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 47,316 KB
最終ジャッジ日時 2023-10-12 11:49:31
合計ジャッジ時間 7,283 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
29,632 KB
testcase_01 AC 125 ms
29,664 KB
testcase_02 AC 125 ms
29,520 KB
testcase_03 AC 126 ms
29,572 KB
testcase_04 AC 126 ms
29,660 KB
testcase_05 AC 130 ms
29,680 KB
testcase_06 AC 128 ms
29,648 KB
testcase_07 AC 127 ms
29,556 KB
testcase_08 AC 293 ms
47,316 KB
testcase_09 AC 312 ms
47,232 KB
testcase_10 AC 306 ms
42,576 KB
testcase_11 AC 241 ms
37,620 KB
testcase_12 AC 321 ms
43,564 KB
testcase_13 AC 191 ms
36,796 KB
testcase_14 AC 224 ms
37,236 KB
testcase_15 AC 396 ms
45,972 KB
testcase_16 AC 400 ms
46,760 KB
testcase_17 AC 398 ms
46,768 KB
testcase_18 AC 367 ms
41,432 KB
testcase_19 AC 393 ms
46,748 KB
testcase_20 AC 398 ms
46,004 KB
testcase_21 AC 127 ms
29,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as p
n=int(input().split()[0])
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