UVA 10228 - Star not a Tree?
题目链接
题意:给定一些点,费马点(到这些点距离和最短),输出距离和
思路:模拟退火去搞,初始温度1W步,降温系数设为0.83,然后每次找周围4个方向,做10次保证答案准确
代码:
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <algorithm>
using namespace std;
const int d[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int N = 105;
const double eps = 1e-3;
int t, n;
struct Po......
阅读全文