[原创]hdu 1007 Quoit Design [sort+分治] 寻找最小距离点对
2016-04-05 20:44:34 Tabris_ 阅读数：383
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 43752 Accepted Submission(s): 11379
Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.
In the field of Cyberground, the position of each toy is fixed, and the ring is carefully designed so it can only encircle one toy at a time. On the other hand, to make the game look more attractive, the ring is designed to have the largest radius. Given a configuration of the field, you are supposed to find the radius of such a ring.
Assume that all the toys are points on a plane. A point is encircled by the ring if the distance between the point and the center of the ring is strictly less than the radius of the ring. If two toys are placed at the same point, the radius of the ring is considered to be 0.
The input consists of several test cases. For each case, the first line contains an integer N (2 <= N <= 100,000), the total number of toys in the field. Then N lines follow, each contains a pair of (x, y) which are the coordinates of a toy. The input is terminated by N = 0.
For each test case, print in one line the radius of the ring required by the Cyberground manager, accurate up to 2 decimal places.
因为数据过多 达到了100000 而且时间只给了1s 如果两两对比的话 一定会超时 所以想到用分治的思想解决 但第一次提交居然WA了一发 之后才想到 光分治还不行 还要对坐标排下序 我采取的是从大到小排x坐标与y坐标和 的方式 点的距离就能分布均匀
然后AC 但是跑了702ms 不开心 #_#~~
看到有人跑了0ms 差距啊 …
# include <iostream>