This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
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 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... |