E - Alternating String 解説
by
TOMWT
An interesting alt solution
After reading the string from input, do the following operation:
- \(s_i\gets s_i\operatorname{xor}(i\bmod 2)\)
Then a string is good \(\iff\) all characters are the same.
Use a datastructure to maintain sum of ranges.
投稿日時:
最終更新: