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

Автор Tutituti, история, 4 года назад, По-английски

You are given n circles (n <= 35000) and m points (m <= 35000). No pair of circles intersect each other. In one turn, you can move a point into or out of a circle, each time it costs amount of given variable which go with each circle. So which you try to find is the minimum cost to gather all point into one region which are divided by the perimeter of circles.

Absolute value of coordinate does not exceed 10^6 Featured cost of each circle does not exceed 10^6, too.

Actually this problem originates from my training test, but I cannot find any solution in contest's t. So I will be really appreciated if you consider to give me any idea.

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

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

Do you have any link of the above question?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I'm pretty sure that there will be some related link but I cannot find it by myself. Sorry

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

Is each point inside at most 1 circle?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    it does not lie on border of any circle, and no two circle intersect but a circle can be completely contained by a larger circle. So a point can be contained by > 1 circle :3

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

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

»
4 года назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

I don't know who dug this up (as it showed in recent actions), but here's a solution: non-intersecting circles can be swept from left to right. When a circle starts, you need to insert two objects to some set: upper and lower arc. Along the sweep line, objects should be sorted by their y-intersection with sweep line (also can be done without it but it's tricky). This way you will figure out parent circle for every circle, thus getting a tree of being-inside-something. Then the task becomes something in a tree.