Problem Statement
给出2n个点,坐标分别为(i,0)(0 <= i < 2n)
有一些点对之间已经有连边
现在要给剩下的点配对
求是否存在一种方案,以配对的点为直径画n个半圆,使得所有半圆两两不交
1 <= 2n <= 50
Consider 2N points in a plane: (0, 0), (1, 0), ..., (2N - 1, 0).
You want to label these points with integers,
such that each integer in { 0, 1, ..., N - 1 } is used twice,
and you can draw N disjoint semicircles in the plane, as follows:
For each j, one of the semicircles has to connect the two points labelled j (See the image in Example 0).
Some points are already labelled.
You are given a int[] labels consisting of 2N elements.
If labels[i] is -1, it means that the point (i, 0) is not labelled yet,
otherwise the point (i, 0) is labelled with the integer labels[i].
Each integer in { 0, 1, ..., N - 1 } will appear in labels either zero or two times.
Return the String "POSSIBLE" if the labelling is possible, "IMPOSSIBLE" otherwise.