QOJ.ac

QOJ

Time Limit: 0.1 s Memory Limit: 512 MB Total points: 100

#1003. 快速 AND 卷积

Statistics

题目描述

给定两个长度为 $2^n$ 的序列 $A,B$,求另一序列 $C$ 使得 $C_k = \displaystyle \sum_{i \ominus j = k} A_i B_j$。

样例输入

输入的第一行包含一个整数 $n$。

接下来一行,包含 $2^n$ 个整数,描述序列 $A$。

接下来一行,包含 $2^n$ 个整数,描述序列 $B$。

样例输出

输出一行 $2^n$ 个整数,描述序列 $C$。答案取模 $998244353$。

样例数据

样例 1 输入

2
1 2 3 4
5 6 7 8

样例 1 输出

103 52 73 32

样例 2 输入

4
5 8 2 7 1 3 6 4 8 8 1 9 3 3 4 5
8 8 1 6 4 4 3 8 1 9 0 5 3 6 2 7

样例 2 输出

1805 1163 269 382 333 171 199 100 460 438 52 133 120 69 46 35

子任务

对于 $100\%$ 的数据,$n \leq 17$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.