Submission #900653

#TimeUsernameProblemLanguageResultExecution timeMemory
9006533laaRoads (CEOI20_roads)C++14
15 / 100
25 ms2052 KiB
#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)

roads.cpp: In function 'int main()':
roads.cpp:30:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<std::pair<long long int, std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(ll i=0 ; i<v.size()-1 ; i++){
      |                  ~^~~~~~~~~~~
#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...