You are given a string $$$s$$$ consisting of characters "1", "0", and "?". The first character of $$$s$$$ is guaranteed to be "1". Let $$$m$$$ be the number of characters in $$$s$$$.
Count the number of ways we can choose a pair of integers $$$a, b$$$ that satisfies the following:
Compute this count modulo $$$998244353$$$.
The first line contains a single string $$$s$$$ ($$$1 \leq |s| \leq 1\,000$$$). $$$s$$$ consists only of characters "1", "0" and "?". It is guaranteed that the first character of $$$s$$$ is a "1".
Print a single integer, the count of pairs that satisfy the conditions modulo $$$998244353$$$.
10110
3
1?0???10
44
1?????????????????????????????????????
519569202
1
0
For the first example, the pairs in base-2 are $$$(111, 10001), (11, 10101), (1001, 11111)$$$.
Name |
---|