# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701582 | PCTprobability | Roads (CEOI20_roads) | C++17 | 1 ms | 212 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.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
#define fi first
#define se second
#define pb push_back
#define sor(a) sort(a.begin(),a.end())
int main(){
ll n;
cin>>n;
map<ll,vector<pair<ll,ll>>> m;
for(int i=0;i<n;i++){
ll a,b,c,d;
cin>>a>>b>>c>>d;
m[a].pb({b,d});
}
vector<pair<ll,vector<pair<ll,ll>>>> d;
for(auto e:m){
sor(e.se);
d.pb({e.fi,e.se});
for(int i=0;i+1<e.se.size();i++){
cout<<e.fi<<" "<<e.se[i].se<<" "<<e.fi<<" "<<e.se[i+1].fi<<endl;
}
}
sor(d);
for(int i=0;i+1<d.size();i++){
cout<<d[i].fi<<" "<<d[i].se.back().se<<" "<<d[i+1].fi<<" "<<d[i].se[0].fi<<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... |