結果

問題 No.2770 Coupon Optimization
ユーザー titiatitia
提出日時 2024-06-03 00:42:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 88,440 KB
最終ジャッジ日時 2024-06-03 00:42:55
合計ジャッジ時間 27,597 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 573 ms
79,160 KB
testcase_01 AC 592 ms
79,012 KB
testcase_02 AC 574 ms
77,200 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 672 ms
79,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 873 ms
80,312 KB
testcase_10 AC 1,165 ms
82,196 KB
testcase_11 AC 1,034 ms
82,256 KB
testcase_12 WA -
testcase_13 AC 1,174 ms
82,000 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

for i in range(M):
    B[i]=100-B[i]

A.sort()
B.sort()

while len(B)<N:
    B.append(100)

import numpy
k=1<<18
g=numpy.fft.fft(A,k)
h=numpy.fft.fft(B,k)

f=[g[i]*h[i] for i in range(k)]

ANS=numpy.fft.ifft(f)

for ans in ANS[:N]:
    print(int(numpy.round(numpy.real(ans/100))))
0