/*
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
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 |
1 |
Failed |
1 ms |
212 KB |
Condition failed: "iA != P2I.end()" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
328 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
9 ms |
1316 KB |
Output is correct |
5 |
Correct |
15 ms |
2056 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
9 ms |
1232 KB |
Output is correct |
5 |
Correct |
17 ms |
2060 KB |
Output is correct |
6 |
Failed |
1 ms |
212 KB |
Condition failed: "iA != P2I.end()" |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
8 ms |
1232 KB |
Output is correct |
5 |
Correct |
16 ms |
2084 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Failed |
1 ms |
340 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 |
1 ms |
212 KB |
Condition failed: "iA != P2I.end()" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Failed |
1 ms |
324 KB |
Condition failed: "iA != P2I.end()" |
2 |
Halted |
0 ms |
0 KB |
- |