摘要: 极角排序 1 #include 2 #include 3 #include 4 #include 5 #define maxn 30000 6 using namespace std; 7 8 struct point 9 {10 double x,y;11 int num;12 }p[maxn];13 point pp;14 double cross(const point &a,const point &b,const point &c)15 {16 return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);17 }18... 阅读全文
posted @ 2014-03-17 21:28 null1019 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 这道题真的很无聊,就是找一个圆,至少有一个点在这个圆上,其他点不能在圆外,半径不定; 1 #include 2 #include 3 #include 4 #include 5 #define maxn 3000 6 using namespace std; 7 8 struct node 9 {10 int x,y;11 }p[300];12 double sqr(double x)13 {14 return x*x;15 }16 bool vis[maxn];17 double dis(int x1,int y1,int x2,int y2)18 {19 ... 阅读全文
posted @ 2014-03-17 20:15 null1019 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const double eps=1e-9; 7 8 double getarea(double a,double b,double c) 9 {10 double p=(a+b+c)/2.0;11 return (c*c/4+sqrt(p*(p-a)*(p-b)*(p-c)));12 }13 14 int main()15 {16 double x,y;17 scanf("%lf%lf",&x,&y);18 ... 阅读全文
posted @ 2014-03-17 19:45 null1019 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define maxn 1000 6 using namespace std; 7 8 int main() 9 {10 int f,n,t,f1;11 double size,size1;12 scanf("%d%lf",&f,&size);13 scanf("%d",&n);14 t=n;15 int ans=0;16 while(t--)17 {18 scanf("%d%lf",&f1,&size 阅读全文
posted @ 2014-03-17 19:11 null1019 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const double pi=acos(-1.0); 7 8 int main() 9 {10 double a,r;11 scanf("%lf%lf",&a,&r);12 if(a>=r*2) printf("%.3lf\n",pi*r*r);//绳子形成的圆在正方形内13 else if(r>=sqrt(2)*a/2) printf("%.3lf\n",a*a);/ 阅读全文
posted @ 2014-03-17 15:22 null1019 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define maxn 2000 6 using namespace std; 7 const double pi=acos(-1.0); 8 9 10 int main()11 {12 double v,a,k;13 scanf("%lf%lf%lf",&v,&a,&k);14 double ans=0;15 a=a*pi/180;16 while(1)17 {18 if(v<0.01) break;19 a... 阅读全文
posted @ 2014-03-17 13:12 null1019 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define maxn 2000 6 using namespace std; 7 const double pi=acos(-1.0); 8 9 double sqr(double x)10 {11 return x*x;12 }13 struct node14 {15 double x,y;16 }p[maxn];17 18 double dis(node a,node b)19 {20 return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y)... 阅读全文
posted @ 2014-03-17 12:58 null1019 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[200000],b[200000]; 7 int main() 8 { 9 int n;10 while(scanf("%d",&n)!=EOF)11 {12 for(int i=1; i<=n; i++)13 scanf("%d",a+i);14 int top=0,top1=1;15 for(int i=1; i<=n; i++)16 {1... 阅读全文
posted @ 2014-03-17 12:33 null1019 阅读(292) 评论(0) 推荐(0) 编辑