Kanade's convolution

TimeLimit:5000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
Give you two arrays $A[0..2^m-1]$ and $B[0..2^m-1]$.

Please calculate array $C[0..2^m-1]$:

$$C[k]=\sum_{i~and~j=k}A[i~xor~j]*B[i~or~j]$$

You just need to print $\sum_{i=0}^{2^m-1}C[i]*1526^i ~mod~998244353$

$m<=19$

$0\leq A[i],B[i]< 998244353$
Input
There is only one test case.

The first line consists of one integer $m$.

The second line consists of $2^m$ integers $A[0..2^m-1]$

The third line consists of $2^m$ integers $B[0..2^m-1]$
Output
Output only one integer means the answer.
SampleInput
2

1 2 3 4

5 6 7 8
SampleOutput
568535691
Submit
题目统计信息详细
总AC数1
通过人数1
尝试人数1
总提交量1
AC率100.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: