AtCoder Grand Contest 046
D
Secret Passage
AtCoder
⌀ 2911
原题
← CE →
翻译中…

Problem Statement

翻译中…

Given is a string $S$ consisting of 0 and 1. Find the number of strings, modulo $998244353$, that can result from applying the following operation on $S$ zero or more times:

翻译中…
  • Remove the two characters at the beginning of $S$, erase one of them, and reinsert the other somewhere in $S$. This operation can be applied only when $S$ has two or more characters.
翻译中…

Constraints

翻译中…
  • $1 \leq |S| \leq 300$
  • $S$ consists of 0 and 1.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the number of strings, modulo $998244353$, that can result from applying the operation on $S$ zero or more times.

翻译中…

样例

Input #1
0001
Output #1
8
Eight strings, `0001`, `001`, `010`, `00`, `01`, `10`, `0`, and `1`, can result.
Input #2
110001
Output #2
24
Input #3
11101111011111000000000110000001111100011111000000001111111110000000111111111
Output #3
697354558
题目信息
题号
agc046_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。