# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
900653 | 3laa | Roads (CEOI20_roads) | C++14 | 25 ms | 2052 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
#include <unordered_map>
#define endl '\n'
#define mid ((l+r)/2)
#define F first
#define S second
#define pb push_back
#define yes void (cout<<"YES"<<endl)
#define no void (cout<<"NO"<<endl)
#define ump unordered_map <ll,ll>
#define sp " "
#define vll vector<ll>
#define vint vector<int>
#define pll pair<ll,ll>
typedef long long ll;
using namespace std;
const ll inf=1e18+9;
const ll M=1e9+7;
ll n;
int main(){
cin>>n;
vector< pair <ll,pair<ll,ll> > > v;
for(ll i=0 ; i<n ; i++){
pll x,y;
cin>>x.F>>x.S>>y.F>>y.S;
v.pb({x.F,{max(x.S,y.S),min(x.S,y.S)}});
}
sort(v.begin(),v.end());
for(ll i=0 ; i<v.size()-1 ; i++){
if(v[i].F!=v[i+1].F){
cout<<v[i].F<<sp<<(v[i].S).F<<sp;
cout<<v[i+1].F<<sp<<(v[i+1].S).F<<endl;
}
else{
if((v[i].S).F<(v[i+1].S).S){
cout<<v[i].F<<sp<<(v[i].S).F<<sp;
cout<<v[i+1].F<<sp<<(v[i+1].S).S<<endl;;
}
else{
cout<<v[i].F<<sp<<(v[i].S).S<<sp;
cout<<v[i+1].F<<sp<<(v[i+1].S).F<<endl;
}
}
}
}
Compilation message (stderr)
# | 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... |