Comments

There is a nice page explaining it, see here.

Thanks for the tips!

I found a pretty good explanation of persistent segment tree here for anyone might be interested. If you know this the solution could be super straightforward.

Note that it's actually a simplified persistency, compare to real persistency like partial persistency and full persistency. There is a pretty good youtube video course that would walk you guys through those ideas if you are interested, see here.

I guess if he use memcpy instead of coping by loop it would be faster. Despite the fact that memcpy also loops it's so much faster.

Thanks for the great round.

Would like to know if anyone could do O(q) or anything better than O(qm) online solution of problem D?

I guess we can just use string here instead of bitset. Bitset has a little more overhead.

When using string, we could add another field inverted that basically keep track of # times operation 3 applied % 2. inverted == 1 means every bits in the string are inverted, otherwise not.

Thanks. :)

The little purple man is not that efficient. :(

tutorials for D & E pls!