标签:style blog io color sp for div on log
1 /* 2 PROBLEM:CF 485B 3 AUTHER:Nicole 4 MEMO:水题 5 */ 6 #include<cstdio> 7 #include<cmath> 8 using namespace std; 9 const long long MAX=9999999999; 10 int main() 11 { 12 long long xmax,xmin,ymax,ymin; 13 xmax=-MAX,ymax=-MAX; 14 xmin=MAX,ymin=MAX; 15 int n; 16 scanf("%d",&n); 17 long long x,y; 18 for (int i=1;i<=n;i++) 19 { 20 scanf("%lld%lld",&x,&y); 21 if (x>xmax) xmax=x; 22 if (x<xmin) xmin=x; 23 if (y>ymax) ymax=y; 24 if (y<ymin) ymin=y; 25 } 26 long long xx=xmax-xmin,yy=ymax-ymin; 27 long long R=xx>yy?xx:yy; 28 long long ans=R*R; 29 printf("%lld\n",ans); 30 return 0; 31 }
水题/CodeForces 485B Valuable Resources
标签:style blog io color sp for div on log
原文地址:http://www.cnblogs.com/NicoleLam/p/4084701.html