SCUT - 77 - Harry Potter and his wand

https://scut.online/p/77
METO said to be single-point update segment tree. To record which point no longer updated, specifically less clear is how to achieve?

A similar idea is to build a balanced n points tree, after each node becomes 0 removed from the tree, up to 30n times change, removing the complexity should be slightly smaller than the 30nlogn, about 5e7.
Each update interval of time, to find the first node in the tree needs to be updated (upperboundL), and then continue to drop and upperbound, single update complexity nlogn, but in fact each node is updated up to 30 times, also the most It is about upperbound30 times.

Query and direct a log.

So the complexity of solving specific about 2e8.

Guess you like

Origin www.cnblogs.com/Yinku/p/11301873.html