Submission #592140

#TimeUsernameProblemLanguageResultExecution timeMemory
592140jasminRoads (CEOI20_roads)C++14
15 / 100
20 ms2264 KiB
#include<bits/stdc++.h> using namespace std; #define int long long const int inf=1e18; void subtask2(int n, vector<pair<pair<int,int>, pair<int,int> > >& p){ sort(p.begin(), p.end()); pair<int,int> last={-inf, -inf}; for(int i=0; i<n; i++){ auto a=p[i].first; auto b=p[i].second; if(last.first!=-inf){ cout << last.first << " " << last.second << " " << a.first << " " << a.second << "\n"; } last=b; } } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<pair<pair<int,int>, pair<int,int> > >p(n); for(int i=0; i<n; i++){ cin >> p[i].first.first >> p[i].first.second; cin >> p[i].second.first >> p[i].second.second; if(p[i].first>p[i].second){ swap(p[i].first, p[i].second); } } subtask2(n, p); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...