RockyYue's blog

By RockyYue, history, 8 months ago, In English

The problem is here.

The solution I've learned is:

Color all the integer points in black and white, a point (x, y) is colored black when 2|(x+y).

If there are both black and white points in the n points, divide them by color.

Otherwise, assuming all the points are black, we rotate and zoom all n points, transforming (x,y) into ((x+y)/2, (x-y)/2).

Then, we solve the sutask, there could be O(logV) subtasks in total before the points don't change.

My problem is:

I know the subtask is equivalent to the original problem, but why is the solution always found in this way when there is a solution?

Thank you for helping!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Let $$$k$$$ be the maximum integer such that $$$2^k \mid (x_i+y_i)$$$ for all $$$i$$$. Then color $$$(x_i, y_i)$$$ black iff it is divisible by $$$2^{k+1}$$$ (this is equivalent to your solution), and by construction at least one point is white. Then for any two points which are the same color, their Euclidean distance is a multiple of $$$2^{k+1}$$$, and for any two points which are different colors, their Euclidean distance is equal to $$$2^k\pmod{2^{k+1}}$$$.

By the way, I think your solution might die if all of the points are white.

Edit: Actually I don't know what your zoom is doing. Anyways, it still doesn't seem to work on all white points.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I mean, if all the points are white, we let all the x[1...n] plus 1, then all of them are black.

    The lowest k bits of x[i]+y[i] should be equal for all i, and No Solution doesn't exist.

    I understand this, thank you!!!