Submission #565705

#TimeUsernameProblemLanguageResultExecution timeMemory
565705SilentVisitorRoads (CEOI20_roads)C++17
15 / 100
17 ms2084 KiB
/* author : SilentVisitor; created on 12.01.22 12.52 A.M. */ #include<bits/stdc++.h> using namespace std; #ifdef _DEBUG #include "algo/debug.h" #else #define debug(...) 69420 #endif #define deb(...) union #define ll long long #define i64 ll64_t #define ff first #define ss second #define all(c) c.begin(), c.end() #define rall(c) c.rbegin(), c.rend() #define sz(s) s.size() vector<char> data = {'a', 'e', 'i', 'o', 'u'}; void solve(int ans = 0){ int n; cin >> n; vector<pair<int, pair<int, int>>> vp(n); for(int i = 0; i < n; i += 1){ int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; if(y1 > y2) swap(y1, y2); vp[i].ff = x1; vp[i].ss = make_pair(y1, y2); } sort(all(vp)); vector<pair<pair<int, int>, pair<int, int>>> dd; for(int i = 1; i < n; i += 1){ dd.push_back(make_pair(make_pair(vp[i].ff, vp[i].ss.ff), make_pair(vp[i-1].ff, vp[i-1].ss.ss))); } for(auto x : dd) cout << x.ff.ff << ' ' << x.ff.ss << ' ' << x.ss.ff << ' ' << x.ss.ss << '\n'; } main(void){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); solve(); return 0; }

Compilation message (stderr)

roads.cpp:44:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   44 | main(void){
      | ^~~~
#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...