题目:http://acm.hdu.edu.cn/showproblem.php?pid=2899 还可三分.不过只写了模拟退火. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<ctime> #include<cmath> #include<cstdlib> #define db double using…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2899 模拟退火: 怎么也过不了,竟然是忘了写 lst = tmp ... 还是挺容易A的. 代码如下: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib> #include<…
求  F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)的最小值 模拟退火,每次根据温度随机下个状态,再根据温度转移 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #define inf (double)0x3f3f3f3f3f3f3f3fll usi…
http://acm.hdu.edu.cn/showproblem.php?pid=2899 Strange fuction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4865    Accepted Submission(s): 3468 Problem Description Now, here is a fuction:  F…
Strange fuction Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5933 Accepted Submission(s): 4194 Problem Description Now, here is a fuction: F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100) C…
Strange fuction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2278    Accepted Submission(s): 1697 Problem Description Now, here is a fuction:  F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=…
题目链接:http://acm.hdu.edu.cn/showproblem.pihp?pid=2899 题目大意:找出满足F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)的x值.注意精确度的问题. 求满足条件的x的最小值!!求导,利用单调性来找到最小值. #include <iostream> #include <cstdio> #include <cmath> using namespace std;…
题目链接 \(Description\) 求函数\(F(x)=6\times x^7+8\times x^6+7\times x^3+5\times x^2-y\times x\)在\(x\in \left[0,100\right]\)时的最小值. \(Solution\) \(x\geq 0\)时\(F(x)\)为单峰凹函数,三分即可. 而且由此可知\(F(x)\)的导数应是单增的.函数最值可以转化为求导数零点问题,于是也可以二分求\(F'(x)\)的零点,或者用牛顿迭代求. 峰值函数最值也可…
三分可以用来求单峰函数的极值. 首先对一个函数要使用三分时,必须确保该函数在范围内是单峰的. 又因为凸函数必定是单峰的. 证明一个函数是凸函数的方法: 所以就变成证明该函数的一阶导数是否单调递增,或者其二阶导数是否大于0. #include<stdio.h> #include<math.h> ; double js(double x,double y){ *pow(x,)+*pow(x,)+*pow(x,)+*pow(x,)-y*x; } int main(){ int n; do…
1.题意:给一个函数F(X)的表达式,求其最值,自变量定义域为0到100 2.分析:写出题面函数的导函数的表达式,二分求导函数的零点,对应的就是极值点 3.代码: # include <iostream> # include <cstdio> # include <cmath> using namespace std; ; double Y; int sgn(double x) { ; ) ; ; } double F(double x) { )+)+)+)-Y*x;…