Problem Description 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 carefull…
大致题意:给N个点,求最近点对的距离 d :输出:r = d/2. // Time 2093 ms; Memory 1812 K #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #define eps 1e-8 #define maxn 100010 #define sqr(a) ((a)*(a)) using namespace std; int sig(dou…
http://acm.hdu.edu.cn/showproblem.php?pid=1007 题意:平面上有n个点,问最近的两个点之间的距离的一半是多少. 思路:用分治做.把整体分为左右两个部分,那么有三种情况:最近的两个点都在左边,最近的两个点都在右边和最近的两个点一个在左边一个在右边.对于第一第二种情况,直接递归处理,分解成子问题就好了,主要是要处理第三种情况.最暴力的做法是O(n^2)的扫,这样肯定会TLE.那么要作一些优化.首先我们先递归处理得到第一种和第二种情况的答案的较小值,然后用这…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1007 题意:给出n个点求最短的两点间距离除以2. 题解:简单的分治. 其实分治就和二分很像二分的写dfs然后复杂度就是log(n*log(n)*log(n)) #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> u…
暂鸽 #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define N 100010 using namespace std; void chkmin(double x,double y) {if (x>y) x=y;} int n; struct point { double x,y; point(){}; point(double _x,double _…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1007 Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 62916    Accepted Submission(s): 16609 Problem Description Have you ever played…
Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29344    Accepted Submission(s): 7688 Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat…
Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 58566    Accepted Submission(s): 15511 Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat…
Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 47104    Accepted Submission(s): 12318 Problem Description Have you ever played quoit in a playground? Quoit is a game in which fla…
Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25335    Accepted Submission(s): 6716 Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat…