随笔分类 -  模拟退火

摘要:[TOC] 题目链接 "loj 2076. 「JSOI2016」炸弹攻击" 题解 模拟退火 退火时,由于答案比较小,但是温度比较高 所以在算exp时最好把相差的点数乘以一个常数让选取更差的的概率降低 代码 c++ include include include include include def 阅读全文
posted @ 2018-09-29 19:04 zzzzx 阅读(372) 评论(3) 推荐(0)
摘要:题目链接 "luogu P3959 宝藏" 题解 开始写了个random_shuffle竟然水了70,然后退火一下就A了? 每次做生成树的时候,随机两条边的顺序交换 退火一下,就A了 代码 c++ include include include include include inline int 阅读全文
posted @ 2018-09-13 21:44 zzzzx 阅读(115) 评论(0) 推荐(0)
摘要:题目链接 [hdu2899Strange fuction] 题解 发现这个东西是个凸的,直接三分 但我想写模拟退火... 代码 c++ include include include inline int read() { int x = 0,f = 1; char c = getchar(); w 阅读全文
posted @ 2018-09-13 15:28 zzzzx 阅读(127) 评论(0) 推荐(0)
摘要:题目链接 "pojA Star not a Tree?" 题解 啊,模拟退火是个好东西 模拟退火即可 代码 c++ include include include inline int read() { int x = 0,f = 1; char c = getchar(); while(c '9' 阅读全文
posted @ 2018-09-13 15:25 zzzzx 阅读(121) 评论(0) 推荐(0)
摘要:题目链接 "bzoj2428: [HAOI2006]均分数据" 题解 模拟退火即可 代码 c++ include include include include const int maxn = 100007; int a[maxn]; double avr,tmpans,ans = 2515656 阅读全文
posted @ 2018-05-06 14:44 zzzzx 阅读(144) 评论(0) 推荐(0)
摘要:题目链接 "bzoj3680: 吊打XXX" 题解 物理题 问题转化为求力的重心 模拟退火即可 代码 c++ include include include include const int maxn = 100007; double x[maxn],y[maxn],w[maxn]; int n; 阅读全文
posted @ 2018-05-06 14:42 zzzzx 阅读(186) 评论(0) 推荐(0)