上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 52 下一页
摘要: 这道题真的很无聊,就是找一个圆,至少有一个点在这个圆上,其他点不能在圆外,半径不定; 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) 编辑
摘要: 这道题是并差集的简单应用 1 #include 2 #include 3 #include 4 #define maxn 100010 5 using namespace std; 6 7 int x[maxn],y[maxn],flag[maxn],f[maxn],t[maxn]; 8 bool vis[maxn]; 9 10 inline int find(int x)11 {12 if(x==f[x]) return x;13 return f[x]=find(f[x]);14 }15 int main()16 {17 int n,m,q;18 s... 阅读全文
posted @ 2014-03-16 23:43 null1019 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 map >t; 8 vector::iterator it; 9 int main()10 {11 int n,x;12 scanf("%d",&n);13 for(int i=1; i<=n; i++)14 {15 scanf("%d",&x);16 t[x].push_back(i);17 }18 int m,r,l;19 scanf... 阅读全文
posted @ 2014-03-16 22:51 null1019 阅读(215) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1126 1 #include 2 #include 3 #include 4 #define maxn 25500 5 using namespace std; 6 7 int a[maxn]; 8 struct node 9 {10 int l,r;11 int max1;12 }tree[maxn*4];13 int max2;14 15 void build(int i,int l,int r)16 {17 tree[i].l=l;tree[i].r=r;18 ... 阅读全文
posted @ 2014-03-15 20:34 null1019 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 52 下一页