QOJ.ac

QOJ

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

#10931. 对合排列

統計

我们称一个排列 $p$ 为对合排列当且仅当对于每个 $i$ 有 $p(p(i))=i$。

对于一个给定的正整数 $k$,你需要对于每个 $u\in [0,k]$ 求出:

  • 所有长度为 $n$ 的对合排列中,逆序对个数 $=u$ 的排列个数 mod 2

输入格式

一行两个整数,$n,k$。

输出格式

一行一个长度为 $n$ 的01串,表示每个 $u\in [0,k]$ 的输出。

样例数据

样例输入

3 9

样例输出

1001000000

子任务

对于 $100\%$ 的数据,$1 \leq k, n \leq 10^6$

测试点 $n \leq$ $k \leq $
$1 \sim 2$ $10$ $50$
$3 \sim 4$ $20$ $200$
$5 \sim 7$ $2\,000$ $2 \times 10^5$
$8$ $5 \times 10^5$
$9\sim 10$ $10^6$
$11 \sim 14$ $10^6$ $5 \times 10^4$
$15 \sim 20$ $10^6$
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.