统计假日AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)Takahashi is creating a work schedule for $N$ days by designating each day as a workday or a holiday.
Takahashi 正在安排 $N$ 天的工作日程,将每天指定为工作日或休息日。AI (CI翻译)
You are given a string $S$ of length $N$ representing the constraints on work days. If the $i$-th character of $S$ is x, day $i$ must be a workday. If it is ., day $i$ can be either a workday or a holiday.
给定一个长度为 $N$ 的字符串 $S$,表示对工作日的限制。如果 $S$ 的第 $i$ 个字符是 x,则第 $i$ 天必须是工作日;如果是 .,则第 $i$ 天可以是工作日,也可以是休息日。AI (CI翻译)
There are $2^q$ valid work schedules satisfying the constraints, where $q$ is the number of . characters in $S$. For each $k=1,2,\dots,N$, solve the following problem:
满足这些限制的工作日程共有 $2^q$ 种,其中 $q$ 是 $S$ 中 . 字符的数量。对于每个 $k=1,2,\dots,N$,请解决以下问题:AI (CI翻译)
Among the
$2^q$valid work schedules satisfying the constraints, find the number, modulo$998244353$, of schedules in which the longest consecutive block of holidays is exactly$k$days.
AI (CI翻译)在满足这些限制的
$2^q$种工作日程中,求最长连续休息日区块恰好为$k$天的日程数量,结果对$998244353$取模。
Constraints
约束条件
AI (CI翻译)$N$is an integer between$1$and$2 \times 10^5$, inclusive.$S$is a string of length$N$consisting of.,x.
$N$是一个介于$1$和$2 \times 10^5$之间的整数(含端点)。$S$是一个长度为$N$、仅由.和x组成的字符串。
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入从标准输入按以下格式给出:AI (CI翻译)
N
S
N
SAI (CI翻译)
Output
输出格式
AI (CI翻译)Output $N$ lines. The $i$-th line should contain the answer for $k=i$.
输出 $N$ 行。第 $i$ 行应包含 $k=i$ 时的答案。AI (CI翻译)
样例
5
.x...
9
4
2
0
0
7
.......
33
47
27
12
5
2
1
20
.....x...x..........
9359
75312
94664
46840
23680
7168
3072
1280
512
256
0
0
0
0
0
0
0
0
0
0
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。