Блог пользователя jasonnguyen.damn

Автор jasonnguyen.damn, история, 12 месяцев назад, По-английски

sorry i don't know how to call this technique so I just named it sqrt decomposition. while I read tutorial of this problem: 797E - Array Queries, i just realize this problem use sqrt decomposition in the strange way that i have never seen before but i couldn't find it's in4 anywhere. can anyone give me this technique's in4 or like how to solve this type of problem. (sorry for my poor english ^^)

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

I like to call it "heavy-light partitioning", a few problems can be found here: https://mirror.codeforces.com/blog/entry/139745?#comment-1248383. General strategy is to find a parameter that can be split to "heavy" and "light", in this case it's $$$k$$$ (process the "light" $$$k$$$'s ($$$\leq \sqrt{n}$$$) and the "heavy" ones separately then combine them somehow.)