結果
問題 | No.1503 Bitwise And Convolution Twisted |
ユーザー | convexineq |
提出日時 | 2021-05-09 07:16:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 975 ms / 2,000 ms |
コード長 | 646 bytes |
コンパイル時間 | 375 ms |
コンパイル使用メモリ | 81,860 KB |
実行使用メモリ | 331,848 KB |
最終ジャッジ日時 | 2023-10-17 16:37:44 |
合計ジャッジ時間 | 8,365 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
53,556 KB |
testcase_01 | AC | 34 ms
53,556 KB |
testcase_02 | AC | 35 ms
53,556 KB |
testcase_03 | AC | 35 ms
53,556 KB |
testcase_04 | AC | 34 ms
53,556 KB |
testcase_05 | AC | 34 ms
53,556 KB |
testcase_06 | AC | 69 ms
77,956 KB |
testcase_07 | AC | 291 ms
163,228 KB |
testcase_08 | AC | 68 ms
77,956 KB |
testcase_09 | AC | 975 ms
331,828 KB |
testcase_10 | AC | 957 ms
331,848 KB |
testcase_11 | AC | 956 ms
331,848 KB |
ソースコード
def zeta_to_high(res,n): for i in range(n): i = 1<<i for j in range(1<<n): if j&i: res[j] += res[j^i] def zeta_to_low(res,n): for i in range(n): i = 1<<i for j in range(1<<n): if j&i == 0: res[j] += res[j^i] def mobius_to_high(res,n): for i in range(n): i = 1<<i for j in range(1<<n): if j&i: res[j] -= res[j^i] MOD = 998244353 n = int(input()) *a, = map(int,input().split()) *b, = map(int,input().split()) zeta_to_low(a,n) mobius_to_high(b,n) for i in range(1<<n): a[i] = (a[i]%MOD)*(b[i]%MOD)%MOD zeta_to_high(a,n) print(*(ai%MOD for ai in a))