Groundhog Build Home Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2647    Accepted Submission(s): 1074 Problem Description Groundhogs are good at digging holes, their home is a hole, usually…
和刚才那道是一模一样 不过求的是最小的,只要稍微修改一下就可以了~ //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include <fstream> #include <cstring> #include <cmath> #include <stack>…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=3932 找一个位置使距离最远的点的距离最小: 上模拟退火: 每次向距离最远的点移动,注意判断一下距离最远的点距离为0的情况. 代码如下: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib&…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=3932 注意平均值与最远的点距离为0的情况.所以初值设成-1,这样 id 就不会乱.不过设成0也可以.注意判断 pr==0 ,因为有除法. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<ctime> #include<cmath&g…
Maple trees Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1847    Accepted Submission(s): 574 Problem Description There are a lot of trees in HDU. Kiki want to surround all the trees with the…
题意 给定一个矩形内的\(n\)个点,在矩形中找一个点,离其他点的最大距离最小. 题解 模拟退火. 这个题需要\(x\)和\(y\)坐标随机动的时候多随机几次.否则就WA了.另外由于随机多次,如果温度变化率太小,就会TLE. 代码 //#include <bits/stdc++.h> #include <cstdio> #include <cmath> #include <ctime> #include <algorithm> #include…
HDU3932 题目大意:给定一堆点,找到一个点的位置使这个点到所有点中的最大距离最小 简单的模拟退火即可 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <algorithm> using namespace std; #define…
http://acm.hdu.edu.cn/showproblem.php?pid=3932 一定范围的平面上给一些点,求到这些点的最大距离最小,和上一题的题意正好相反,稍微改一下就可以 这个问题又叫最小圆覆盖 #include <iostream> #include <cstdio> #include <cstring> #include <map> #include <ctime> #include <cmath> using n…
题意:找出一点,距离所有所有点的最短距离最大 二维平面内模拟退火即可,同样这题用最小圆覆盖也是可以的. Source Code: //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include <fstream> #include <cstring> #include <cm…
Number Sequence Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11691    Accepted Submission(s): 5336 Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1],…