3 3 100 2 1 2 ? 3 ?
5
7
10
* The $1$\-st query starts by changing $S$ to `110`. Five strings can be obtained as a subsequence of $S = $ `110`: `0`, `1`, `10`, `11`, `110`. Thus, the $1$\-st query should be answered by $5$.
* The $2$\-nd query starts by changing $S$ to `1?0`. Two strings can be obtained by the `?` in $S = $ `1?0`: `100` and `110`. Seven strings can be obtained as a subsequence of one of these strings: `0`, `1`, `00`, `10`, `11`, `100`, `110`. Thus, the $2$\-nd query should be answered by $7$.
* The $3$\-rd query starts by changing $S$ to `1??`. Four strings can be obtained by the `?`'s in $S = $ `1??`: `100`, `101`, `110`, `111`. Ten strings can be obtained as a subsequence of one of these strings: `0`, `1`, `00`, `01`, `10`, `11`, `100`, `101`, `110`, `111`. Thus, the $3$\-rd query should be answered by $10$.40 10 011?0??001??10?0??0?0?1?11?1?00?11??0?01 5 0 2 ? 30 ? 7 1 11 1 3 1 25 1 40 0 12 1 18 1
746884092 532460539 299568633 541985786 217532539 217532539 217532539 573323772 483176957 236273405 Be sure to print the count modulo $998244353$.
{
"problem": {
"name": "Ex - 01? Queries",
"description": {
"content": "You are given a string $S$ of length $N$ consisting of `0`, `1`, and `?`. You are also given $Q$ queries $(x_1, c_1), (x_2, c_2), \\ldots, (x_Q, c_Q)$. For each $i = 1, 2, \\ldots, Q$, $x_i$ is an int",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 6000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc246_h"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a string $S$ of length $N$ consisting of `0`, `1`, and `?`.\nYou are also given $Q$ queries $(x_1, c_1), (x_2, c_2), \\ldots, (x_Q, c_Q)$. \nFor each $i = 1, 2, \\ldots, Q$, $x_i$ is an int...",
"is_translate": false,
"language": "English"
}
]
}