A new approach to solve online MO problems

Правка en1, от Alwoosh, 2024-12-25 09:37:57

In the last Educational Round, I implemented next solution for G problem(2043-G - Problem with Queries), and never seen before, solution like this, for online MO problems.

298356157

In the problems, we have to find number of pairs of unequal values in the some range. Also, we have updates, and queries — online.

Firstly, I change our task to find pairs of equal values, and imediatelly think about MO(offline solution of problem). Instead of one supported MO segment, I decided to support 500 MO segments. In the updates, I just update MO segments that have that value inside of segment. And for the second type of queries, firstly I find MO segment that needed less iterations to reach the range from the query.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский Alwoosh 2024-12-25 12:56:35 0 (published)
en4 Английский Alwoosh 2024-12-25 11:56:01 497 (saved to drafts)
en3 Английский Alwoosh 2024-12-25 10:43:51 0 (published)
en2 Английский Alwoosh 2024-12-25 10:43:18 172
en1 Английский Alwoosh 2024-12-25 09:37:57 770 Initial revision (saved to drafts)