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

Windycaution's blog

By Windycaution, history, 10 months ago, In English

Hello folks on CodeForces. I came across with a problem adapted from a CodeForces problem (one of my seniors, whom I cannot get contact, used it in our exams, and his tutorial is too intricate for me T_T). So I'd appreciate it if any mates recognise this statement and can tell me its source problem.

Thanks in advance! ❤

Statement: There are two multisets $$$A$$$ and $$$B$$$, both initially empty. And there are $$$m$$$ operations, in one of which a pair of two integers $$$(a_i, b_i)$$$ will be added into/deleted from either $$$A$$$ or $$$B$$$. After every operation, find the minimum of $$$\max(a_x+a_y, b_x+b_y)$$$, where $$$x \in A, y \in B$$$.

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it

By Windycaution, history, 2 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it