摘要:
1 #include 2 #include 3 4 using namespace std; 5 6 const unsigned int MAX = 10000; //整型数组的最大长度 7 const long long WIDTHMAX = 1000000000; //整型数组val[MAX]的元素上限 8 const unsigned int WIDTH = 9; //输出整型数组val[MAX]的元素时的格式宽度,即整型数组val[MAX]的元素的最多位数 9 10 typedef struct node 11 { 12 long long ... 阅读全文
posted @ 2013-07-11 21:44
Sky-J
阅读(288)
评论(0)
推荐(0)
摘要:
首先这题是一道物理题,需要我们根据题意抽象一个函数出来。对物体的运动作分解后,可以得到:f(t)=x*tan(t)-g*x*x/(v*cos(t))^2/2,其中t表示v与x轴正向的夹角(弧度),f(t)表示物体的运动轨迹与直线x0=x的交点纵坐标。分析后可以得到该函数在区间(0,π/2)上先增后减,所以我们可以在该区间上三分,求出使函数取得极大值的角度t0。若f(t0)#include#includeusing namespace std;const double eps=1.0e-9;const double PI=acos(-1.0);const double g=9.8;double 阅读全文
posted @ 2013-07-11 16:47
Sky-J
阅读(196)
评论(0)
推荐(0)
摘要:
#include #include #include #include #include #include #include #include #include #include#includeusing namespace std ;#ifdef DeBUG#define bug assert#else#define bug //#endif#define eps 1e-6int m,n;double pie[11000];bool test(double x)//判断是否每个都分成出x体积大的蛋糕的块数>=人数,=人数那最好了^_^{int sum=0;for(int i=0;i=( 阅读全文
posted @ 2013-07-11 15:10
Sky-J
阅读(411)
评论(0)
推荐(0)
摘要:
#include #include #include #include #include #include #include #include #include #include#includeusing namespace std ;#ifdef DeBUG#define bug assert#else#define bug //#endif#define eps 1e-10double a[10010],b[10010],c[10010];int m;inline double f(double x){int i;double maxx=a[0]*x*x+b[0]*x+c[0];for(i 阅读全文
posted @ 2013-07-11 13:17
Sky-J
阅读(246)
评论(0)
推荐(0)
浙公网安备 33010602011771号