No.1654 Binary Compression
問題文最終更新日: 2021-08-09 09:32:41
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 310
(順位表)
の他の問題:
Problem Statement
Rusk has a string $S$ consisting only of 0 and 1. He can perform the following operation any number of times.
- Choose $2$ adjacent characters of $S$ and delete the digit that is not the larger one.
Input
$S$
- $1\leq |S|\leq 3\times 10^6$
- Each character of $S$ is
0or1.
Output
Output the number of possible strings $S$ after the operations, modulo $924844033$.
Sample
Sample 1
Input
00101
Output
9
The possible strings $S$ after the operations are the following $9$: 1, 01, 11, 001, 011, 101, 0011, 0101, 00101.
For example, 01 can be obtained by performing the operations as follows.
- Choose the $1$st and $2$nd characters of $S$ and delete the $1$st character. $S$ becomes
0101. - Choose the $2$nd and $3$rd characters of $S$ and delete the $3$rd character. $S$ becomes
011. - Choose the $2$nd and $3$rd characters of $S$ and delete the $2$nd character. $S$ becomes
01.
Sample 2
Input
1111
Output
4
Sample 3
Input
1001001001001001001001001001001001001001001001001001001001001
Output
605956436
Output the answer modulo $924844033$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
chocorusk