Submission #1289453

#TimeUsernameProblemLanguageResultExecution timeMemory
1289453LIARoads (CEOI20_roads)C++17
0 / 100
1 ms14652 KiB
//
// Created by liasa on 11/11/2025.
//

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
const ll mod = 1e9 + 7;

#define tpl tuple<ll, ll, ll, ll, ll>

int main() {
  ll n;
  cin >> n;
  vector<tpl> v(n);
  for (ll i = 0; i < n; ++i) {
    ll x, y, x1, y1;
    cin >> x >> y >> x1 >> y1;
    if (y > y1)
      swap(y, y1);
    if (x > y1)
      swap(x, x1);
    v[i] = {y, x1, x, y1, i};
  }

  sort(v.begin(), v.end());
  vector<tpl> ans;

  for (ll i = 1; i < n; ++i) {
    ll y = get<0>(v[i - 1]);
    ll x = get<1>(v[i - 1]);
    ll y1 = get<0>(v[i]);
    ll x1 = get<2>(v[i]);
    ans.push_back({x, y, x1, y1, 0});
  }

  for (auto [a, b, c, d, t] : ans) {
    cout << a << " " << b << " " << c << " " << d << "\n";
  }
}
#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...