【GYM101409】2010-2011 ACM-ICPC, NEERC, Western Subregional Contest

A-Area and Circumference

题目大意:在平面上给出$N$个三角形,问周长和面积比的最大值。

【GYM101409】2010-2011 ACM-ICPC, NEERC, Western Subregional Contest

【GYM101409】2010-2011 ACM-ICPC, NEERC, Western Subregional Contest

1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <stdio.h> 5 #include <cstdio> 6 #include <cmath> 7 #include <string> 8 #include <queue> 9 #include <vector> 10 #include <map> 11 #include <iomanip> 12 using namespace std; 13 const int N=1e5+7; 14 //const double eps = 1e-8; 15 double ax,ay,bx,by; 16 double x[N]; 17 double chang,kuan; 18 int main() 19 { 20 freopen("area.in","r",stdin); 21 freopen("area.out","w",stdout); 22 int n; 23 scanf("%d",&n); 24 for(int i=1;i<=n;i++) 25 { 26 scanf("%lf%lf%lf%lf",&ax,&ay,&bx,&by); 27 chang=fabs(bx-ax); 28 kuan=fabs(ay-by); 29 x[i]=chang*kuan/(chang+chang+kuan+kuan); 30 } 31 sort(x+1,x+1+n); 32 printf("%lf\n",x[n]); 33 }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zyfwss.html