【POJ2069&HDU3007】模拟退火算法之最小球/圆覆盖

启蒙博客:https://blog.csdn.net/AI_BigData_wh/article/details/77943787?locationNum=2&fps=1

POJ2069:最小球覆盖


被精度搞死。。POJ做题经常被精度卡到怀疑人生。。好感-1-1-1...-1

队友的模拟退火的模版好像是错的(但是能过HDU3007,很玄学了)。初识温度的设置不能太大,会影响最终结果的准确度。

ac代码:

#include <iostream>
#include <cmath>
using namespace std;
const int maxn = 40;
const double eps = 1e-7;
const double DINF = 0x7fffffff;
const double initT = 400;//设小了可能会wa,POJ2069开到500会wa,200-400可行
struct Point{
    double x, y, z;
    Point(double x = 0, double y = 0, double z = 0):x(x),y(y),z(z){}
};
Point p[maxn];
int n;
double dist(Point a, Point b)
{
    return sqrt((a.x
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值