思路:开个 bitset 维护 BBB 中不为 111 的位置,用线段树维护 AAA 暴力跳。但是 AC34 WA7。
bitset
Link,那一坨 SegmentTree 不用管。
SegmentTree