1??00
2
There are $4$ ways to replace the question marks with `0` or `1` :
* `11100` : This string is beautiful because we can first perform the operation on the last $3$ bits to get `110` and then on the only $3$ bits to get `1`.
* `11000` : This string is beautiful because we can first perform the operation on the last $3$ bits to get `110` and then on the only $3$ bits to get `1`.
* `10100` : This string is not beautiful because there is no sequence of operations such that the final string is `1`.
* `10000` : This string is not beautiful because there is no sequence of operations such that the final string is `1`.
Thus, there are $2$ ways to form a beautiful string.?
1 In this case, `1` is the only beautiful string.
?0101???10???00?1???????????????0????????????1????0
402589311
Remember to output your answer modulo $10^{9} + 7$.{
"problem": {
"name": "Median Replace",
"description": {
"content": "Taichi thinks a binary string $X$ of odd length $N$ is **beautiful** if it is possible to apply the following operation $\\frac{N-1}{2}$ times so that the only character of the resulting string is `1` ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc022_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Taichi thinks a binary string $X$ of odd length $N$ is **beautiful** if it is possible to apply the following operation $\\frac{N-1}{2}$ times so that the only character of the resulting string is `1` ...",
"is_translate": false,
"language": "English"
}
]
}