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

Автор zzzzsust19, история, 14 месяцев назад, По-английски

This is a convex hull trick problem. I am building my convex hull from leaf to higher nodes. Every time I am going through all my child nodes, I am merging them together. In this solution, I am not applying light to heavy technique. Because of the increasing CHT size, I would expect my solution to get TLE on the given constraints. But for some reason, it's not getting TLE. Anyone got any proper explanation?

Problem: 932F - Escape Through Leaf

My submission: 227235272

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

»
14 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by zzzzsust19 (previous revision, new revision, compare).

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

It might be that on random tests the average size of the CHT is O(log N) where N is the number of elements added at some point in time. Also you might get lucky and have the heavy nodes coveniently placed.

  • »
    »
    14 месяцев назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    Yeah, but if the tree is carefully created it's possible that no line in the convex hull get's deleted. There should be test cases like that