This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
struct Point{
int x, y;
};
const int MAX_N = 1e5;
pair<Point, Point> pts[MAX_N];
signed main(){
int n;
cin>>n;
for(int i = 0; i<n; i++){
Point a, b;
cin>>a.x>>a.y>>b.x>>b.y;
pts[i] = {a, b};
}
auto cmp =[&](pair<Point, Point>& a, pair<Point, Point>& b){
if(a.first.x!=b.first.x){
return a.first.x<b.first.x;
}
else{
return a.first.y< b.first.y;
}
};
sort(&pts[0], &pts[n], cmp);
for(int i = 0; i<n-1; i++){
cout<<pts[i].second.x<<" "<<pts[i].second.y<<" "<<pts[i+1].first.x<<" "<<pts[i+1].first.y<<endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |