# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
900653 | 2024-01-08T19:39:41 Z | 3laa | Roads (CEOI20_roads) | C++14 | 25 ms | 2052 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Failed | 0 ms | 348 KB | Condition failed: "iA != P2I.end()" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 13 ms | 1364 KB | Output is correct |
5 | Correct | 25 ms | 1996 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 392 KB | Output is correct |
3 | Correct | 2 ms | 348 KB | Output is correct |
4 | Correct | 13 ms | 1332 KB | Output is correct |
5 | Correct | 25 ms | 1992 KB | Output is correct |
6 | Failed | 1 ms | 348 KB | Condition failed: "iB != P2I.end()" |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 2 ms | 348 KB | Output is correct |
4 | Correct | 13 ms | 1272 KB | Output is correct |
5 | Correct | 25 ms | 2052 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Failed | 1 ms | 348 KB | Condition failed: "pf == Sline.end() || !Cross(S[*pi], S[*pf])" |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Failed | 0 ms | 348 KB | Condition failed: "iA != P2I.end()" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Failed | 0 ms | 344 KB | Condition failed: "iA != P2I.end()" |
2 | Halted | 0 ms | 0 KB | - |