poj1379】的更多相关文章

poj1379 题意 给出 n 个洞的坐标,要求找到一点使得这一点距离最近洞的距离最远. 分析 通过这道题学习一下模拟退火算法, 这种随机化的算法,在求解距离且精度要求较小时很有用. 简而言之,由随机选取的多个初始点,进行多次的随机变换,并根据是否更优而选择是否保留答案, 那么首先要选择两个值,delta 表示初始最大变换的半径(即对应初始的火温),d 控制半径缩小的快慢(火温减小的快慢). 这道题,比较直白,随机变换就是改变坐标的位置(通过半径和角度就可以变换坐标,当然角度也是随机的),若变换…
题意:平面上找一个点,使得其到给定的n个点的距离的最小值最大. 模拟退火看这篇:http://www.cnblogs.com/autsky-jadek/p/7524208.html 这题稍有不同之处仅有:多随机几个初始点,以增加正确率. 另:WA了几百遍竟然是因为最后输出了-0.0这样的值…… #include<cstdio> #include<cmath> #include<algorithm> #include<cstdlib> using namesp…
题意:和上题一样...就是把最小值换成了最大值.. ref:http://www.cppblog.com/RyanWang/archive/2010/01/21/106112.html #include<iostream> #include<cstdio> #include<cmath> #include<ctime> using namespace std; #define eps 1e-3 #define pi acos(-1.0) #define PO…
http://poj.org/problem?id=1379 Run Away Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 6095   Accepted: 1869 Description One of the traps we will encounter in the Pyramid is located in the Large Room. A lot of small holes are drilled in…
传送门:http://poj.org/problem?id=1379 [题解] 题目大意:求(0,0)->(X,Y)内的一个点,使得这个点到给定的n个点的最小距离最大. 模拟退火 一开始可以先把4个顶点加入. 调调参就过样例了. 然后就过了 # include <math.h> # include <stdio.h> # include <stdlib.h> # include <string.h> # include <iostream>…
题目链接: Run Away Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 7982   Accepted: 2391 Description One of the traps we will encounter in the Pyramid is located in the Large Room. A lot of small holes are drilled into the floor. They look c…
我对模拟退火的理解:https://www.cnblogs.com/AKMer/p/9580982.html 我对爬山的理解:https://www.cnblogs.com/AKMer/p/9555215.html 题目传送门:http://poj.org/problem?id=1379 题目意思是要求规定大小平面内某一点,该点到所有给定点的距离中最小距离最大. 类似于费马点做法--不过把统计距离和变成了求距离最小值最大. 费马点不会的可以先看看这篇博客. BZOJ3680:吊打XXXhttps…
题目链接: A Star not a Tree? Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5219   Accepted: 2491 Description Luke wants to upgrade his home computer network from 10mbs to 100mbs. His existing network uses 10base2 (coaxial) cables that allo…
/* 题意:给n个电脑,求一个点到这n个电脑的距离和最小. 模拟退火法:和poj1379的方法类似 因为坐标范围是0-10000 不妨把它看成是10000*10000的正方形来做 */ #include<stdio.h> #include<math.h> #include<iostream> #include<algorithm> #define inf 10000000000000 using namespace std; #define N 110 #d…