HDOJ 5017 Ellipsoid】的更多相关文章

第一次尝试模拟退火..... Ellipsoid Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 916    Accepted Submission(s): 305 Special Judge Problem Description Given a 3-dimension ellipsoid(椭球面) your task is to…
简单地模拟退火. /* 5017 */ #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #define INF 1e30 ; const double next = 0.99; ][] = { {-, }, {, }, {, -}, {, }, {-, }, {-, -}, {, -}, {, } }; double a, b, c, d, e, f; doub…
Ellipsoid Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 850    Accepted Submission(s): 271 Special Judge Problem Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minima…
Problem Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points (x1,y1,z1) and (x2,y2,z2) is defined as    Input There ar…
为了补这题,特意学了下模拟退火算法,感觉算法本身不是很难,就是可能降温系数,步长等参数不好设置. 具体学习可以参见: http://www.cnblogs.com/heaad/archive/2010/12/20/1911614.html  我认为讲的很不错,通俗易懂. 这题设置一个step为1,降温系数为0.99,因为系数越大,得到最优解的概率越大,虽然可能会慢一点.因为是三维的,所以往八个方向扩展找邻域解,然后遇到比他优的解一定接受. 代码:(参照网上代码) #include <iostre…
题意 给一个三维椭球面,求球面上距离原点最近的点.输出这个距离. 题解 模拟退火. 把\(z = f(x, y)\)函数写出来,这样通过随机抖动\(x\)和\(y\)坐标就能求出\(z\). 代码 //#include <bits/stdc++.h> #include <cstdio> #include <cmath> #include <ctime> #include <algorithm> #include <iostream>…
Preface 老叶说了高中停课但是初中不停的消息后我就为争取民主献出一份力量 其实就是和老师申请了下让我们HW的三个人听课结果真停了 那么还是珍惜这次机会好好提升下自己吧不然就\(AFO\)了 List Luogu P4198 楼房重建 把高度化为斜率,然后就是个动态最长上升子序列的问题了,线段树上二分即可解决,而且可以做到\(O(n\log n)\) NOIP模拟赛10.24 实力翻车,T1主席树裸题切了,T2想了贪心+前缀和+二分正解,最后1min写完发现忘记判边界了炸到60,T3以为很难…
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56784    Accepted Submission(s): 19009 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats g…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
Box of Bricks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5994    Accepted Submission(s): 2599 Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one up…