摘要: 题意: bfs:从1,1,1到a,b,c的最短时间View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<queue> 5 #include<algorithm> 6 using namespace std; 7 const int maxn = 55; 8 const int inf = 9999999; 9 int mat[ maxn ][ maxn ][ maxn ];10 const int dx[6]={0,-1,0 阅读全文
posted @ 2013-01-27 15:42 xxx0624 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 转化为求给定的函数与X轴的交点二分即可View Code 1 #include<stdio.h> 2 #include<math.h> 3 4 double func( double x,double y ){ 5 double ans; 6 ans=8*pow( x,4.0 )+7*pow( x,3.0 )+2*pow( x,2.0 )+3*x+6.0-y; 7 return ans; 8 } 9 int judge( double y ){10 double t1,t2;11 t1=func( 0,y ),t2=func( 100,y );12 ... 阅读全文
posted @ 2013-01-27 15:00 xxx0624 阅读(287) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<math.h> 3 4 double func( double x,double y ){ 5 double ans; 6 ans=6*pow( x,7.0 )+8*pow( x,6.0 )+7*pow( x,3.0 )+5*pow( x,2.0 )-y*x; 7 return ans; 8 } 9 10 int main(){11 int T;12 scanf("%d",&T);13 while( T-- ){14 double y;15 ... 阅读全文
posted @ 2013-01-27 14:46 xxx0624 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 题意:由题意给出的函数,求出最小值的x方法一先求导,导数等于0的位置就是F(x)最小的位置( 仅限此题)View Code 1 #include<stdio.h> 2 #include<math.h> 3 4 double func( double x,double y ){ 5 double ans; 6 ans=42.0*pow( x,6.0 )+48.0*pow( x,5.0 )+21.0*x*x+10.0*x-y; 7 return ans; 8 } 9 10 double func2( double x,double y ){11 double a... 阅读全文
posted @ 2013-01-27 14:36 xxx0624 阅读(219) 评论(0) 推荐(0) 编辑