摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6604 Problem Description Country A and B are at war. Country A needs to organize transport teams to deliver 阅读全文
posted @ 2019-07-29 18:39 Snow_in_winer 阅读(196) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; struct Point { double x,y; Point() {}; Point(int _x,int _y):x(_x),y(_y) {}; } p[400]; double dis(Point a,Point b) { return sqrt(... 阅读全文
posted @ 2019-07-29 11:42 Snow_in_winer 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 采用分治的思想,把n个点按照x坐标进行排序,以坐标mid为界限分成左右两个部分,对左右两个部分分别求最近点对的距离,然后进行合并。对于两个部分求得的最近距离d,合并过程中应当检查宽为2d的带状区间是否有两个点分属于两个集合而且距离小于d,最多可能有n个点,合并时间最坏情况下是O(n^2).但是,左边 阅读全文
posted @ 2019-07-29 11:00 Snow_in_winer 阅读(237) 评论(0) 推荐(0) 编辑