QOJ.ac

QOJ

Time Limit: 12 s Memory Limit: 1024 MB Total points: 100

#1930. Бессознательная перестановка Коиши

Statistics

Закрыв глаз Сатори, способный читать мысли, Койши обрела способность жить в бессознательном состоянии. Даже она сама не знает, что она задумала. — Subterranean Animism

Койши бессознательно переставляет $n$ чисел: $1, 2, \ldots, n$.

Она считает перестановку $p$ красивой, если $s=\sum\limits_{i=1}^{n-1} [p_i+1=p_{i+1}]$. $[x]$ равно $1$, если условие $x$ истинно, и $0$ в противном случае.

Для каждого $k\in[0,n-1]$ она хочет узнать количество красивых перестановок длины $n$, удовлетворяющих условию $k=\sum\limits_{i=1}^{n-1}[p_i< p_{i+1}]$.

Входные данные

В одной строке записаны два целых числа $n$ ($1 \leq n \leq 250\,000$) и $s$ ($0 \leq s < n$).

Выходные данные

Выведите одну строку, содержащую $n$ целых чисел. $i$-е число представляет собой ответ для $k=i-1$ по модулю $998244353$.

Примеры

Входные данные 1

2 0

Выходные данные 1

1 0

Входные данные 2

4 1

Выходные данные 2

0 3 6 0

Входные данные 3

8 3

Выходные данные 3

0 0 0 35 770 980 70 0

Примечание

Пусть $f(p)=\sum\limits_{i=1}^{n-1}[p_i < p_{i+1}]$.

Тест 1:

$[2,1]$ — единственная красивая перестановка. При этом $f([2,1])=0$.

Тест 2:

Красивые перестановки:

$[1,2,4,3]$, $[1,3,4,2]$, $[1,4,2,3]$, $[2,1,3,4]$, $[2,3,1,4]$, $[3,1,2,4]$, $[3,4,2,1]$, $[4,2,3,1]$, $[4,3,1,2]$. Первые шесть из них удовлетворяют $f(p)=2$, в то время как остальные удовлетворяют $f(p)=1$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.