Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Is there any persistent segment tree impl by std::vector ?

Revision en1, by Windycaution, 2022-02-22 10:07:27

Hello, I have recently got haunted by telling the size of memory pool of persistent segment tree, getting WA / RE / MLE results on many problems. Therefore, I'd appreciate it if someone could give me a implementation of persistent segtree applying std::vector to manage the memory (in order to avoid getting WA / RE / MLE by telling wrongly the size of arrays), which I could not find one anywhere on the Internet.

If the code could be laconic as well, it would be better.

Thank you!

Tags persistent segment trees

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Windycaution 2022-02-22 10:07:27 549 Initial revision (published)