2026牛客国庆集训派对day6
Removing Elements官方中文
题目描述
官方中文Let $T \subseteq \{1,2,\ldots,n\}$ be a set of integers. Suppose you have a set $S = \{1,2,\ldots,n\}$. You may perform the following operations an arbitrary number of times (including zero times): Choose $k \in T$ such that $k \le |S|$; Remove the $k$-th largest element in $S$. Find the total number of sets $S$ that can be generated through the process. The answer might be enormous, and you should output the desired value modulo $998\,244\,353$.官方中文
输入格式
官方中文The first line of input contains an integer $n$ ($1 \le n \le 200\,000$).官方中文
The second line of input contains a binary string $s=s_1 s_2\ldots s_n$ of length $n$, denoting the set $T=\{1 \le i \le n \mid s_i = 1\}$.官方中文
输出格式
官方中文Output an integer in a line, denoting the answer.官方中文
样例
Input #1
3
101Output #1
6Input #2
5
00001Output #2
2Input #3
10
1011011000Output #3
695题目信息
题面与样例版权归 牛客竞赛 及出题人所有;中文翻译由 AI 生成(官方原文),如有出入请以原文为准。