G - LOWER 解説 by evima

Another solution by proposer

This is somewhat of a joke, but you can solve it by using a Lazy Segment Tree to manage the numbers of uppercase and lowercase letters in each interval within the string. (You can naively update which of A, B, …, Z each letter is.)

Sample Implementation(C++)

投稿日時:
最終更新: