Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Блог пользователя szawinis

Автор szawinis, история, 10 лет назад, По-английски

Problem Statement: Click

It definitely requires convex hull optimization, but I'm not sure how to merge the sets properly. I've thought about the usual "merge the small subtree to the large subtree" trick, but it doesn't seem to work. Is there anything I'm missing? And also, which variant of the convex hull optimization should I use? Does it require the fully dynamic variant?

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

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You can view judge solutions and I/O here: http://serjudging.vanb.org/?cat=28

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

It can be solved with static version of convex hull trick where you can pre-sort slopes. You want to combine it with centroid decomposition. It's simplified when you notice that you don't have to consider strict paths. Walks that have repeated edges are always worse than paths with no repeated edges.

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

I would like to share my AC code, for those who get stuck with the problem and cannot find any code on the net like me.

code