Why the answer is 16 but not 8 in Example 1? I can only figure out the 8 strings below
- B AAAAAAA ABBABAB
- B AAAAAAA ABBABBA
- B AAAAAAA ABABBAB
- B AAAAAAA ABABBBA
- B ABBABAB AAAAAAA
- B ABBABBA AAAAAAA
- B ABABBAB AAAAAAA
- B ABABBBA AAAAAAA
# | User | Rating |
---|---|---|
1 | jiangly | 4039 |
2 | tourist | 3841 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3590 |
5 | ecnerwala | 3542 |
6 | Benq | 3535 |
7 | orzdevinwang | 3526 |
8 | gamegame | 3477 |
9 | heuristica | 3357 |
10 | Radewoosh | 3355 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | atcoder_official | 160 |
3 | Um_nik | 160 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 153 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
Why the answer is 16 but not 8 in Example 1? I can only figure out the 8 strings below
Name |
---|
I think you misinterpreted $$$s_i$$$ and the input. I recommend reading the definition of $$$s_i$$$ and the input again. "B ABBABAB AAAAAAA" is not a valid constellation. The children of $$$s_1$$$ are $$$s_2$$$ and $$$s_3$$$, not $$$s_2$$$ and $$$s_9$$$.
What could've lead to this confusion: The preorder string of input "BAAAAAAAABBABAB" is not "BAAAAAAAABBABAB".
oh, thank you for explaining it to me, i've been confused about this for hours..