2019长沙学院新生赛 B,G代码
B 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int n; 5 int a[300005]; 6 7 int main(){ 8 scanf("%d",&n); 9 for(int i=1;i<=n*3;i++){ 10 scanf("%d",&a[i]); 11 } 12 sort(a+1,a+1+n*3); 13 int ans=0; 14 for(int i=1;i<=n*3;i+=3){ 15 ans=max(ans,a[i+2]-a[i]); 16 } 17 printf("%d\n",ans); 18 } G 1 #include<bits/stdc++.h> 2 using namespace std; 3 const double Pi=acos(-1); 4 const double eps=1e-10; 5 struct Point{//点 6 double x,y; 7 Point(double x=0,double y=0):x(x),y(y){}; 8 }; 9 typedef Point Vector; 10 Vector operator +(Vector A,Vector B){return Vector(A.x+B.x,A.y+B.y);} 11 Vector operator -