5 4 ABBA 5 AAAAA 6 BBBBBB 7 ABABABA 20 AAABBBBBBBBAAABBBABA
1333 12321 333333 1313212 33311111133121111311 Let us describe the changes in $(h_1, h_2, h_3, P)$ as we proceed with $i = 1, 2, \dots, N$. * For the first test case, $(0,0,0,0) \rightarrow (2,0,0,0) \rightarrow (2,1,1,0) \rightarrow (2,2,2,1) \rightarrow (2,2,4,1)$. The maximum score is $1$. * For the second test case, $(0,0,0,0) \rightarrow (2,0,0,0) \rightarrow (2,2,0,0) \rightarrow (2,2,2,1) \rightarrow (2,4,2,1) \rightarrow (4,4,2,1)$. The maximum score is $1$. For the third, fourth, and fifth test cases, the maximum scores are $0$, $0$, and $2$, respectively. There may be multiple strings $X$ that maximize the score, but you only need to print one of them.
{
"problem": {
"name": "All the Same",
"description": {
"content": "You are given a string $S$ of length $N$ consisting of the characters `A` and `B`. For a string $X$ of length $N$ consisting of the characters `1`, `2`, and `3`, the **score** is determined by the fol",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc179_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a string $S$ of length $N$ consisting of the characters `A` and `B`.\nFor a string $X$ of length $N$ consisting of the characters `1`, `2`, and `3`, the **score** is determined by the fol...",
"is_translate": false,
"language": "English"
}
]
}