Submission #667561

# Submission time Handle Problem Language Result Execution time Memory
667561 2022-12-01T17:32:33 Z mychecksedad Roads (CEOI20_roads) C++17
15 / 100
21 ms 1876 KB
/* Author : Mychecksdead */
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef long double ld;
#define MOD1 (1000000000+7)
#define MOD (998244353)
#define PI 3.1415926535
#define pb push_back
#define setp() cout << setprecision(15)
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " is " << x << '\n';
const int N = 1e6+100, M = 1e5+10, F = 2147483646, K = 20;

int n;
array<int, 5> p[N];
pair<int, int> comp(pair<int, int> a, pair<int, int> b){
    if(a.first != b.first) return (a.first < b.first ? a : b);
    return (a.second < b.second ? a : b);
}

void solve(){
    cin >> n;
    for(int i = 0; i < n; ++i){
        cin >> p[i][0] >> p[i][1];
        cin >> p[i][2] >> p[i][3];
        if(p[i][1] < p[i][3]){
            swap(p[i][1], p[i][3]);
            swap(p[i][0], p[i][2]);
        }
        p[i][5] = i;
    }
    sort(p, p + n);
    for(int i = 0; i < n - 1; ++i){
        if(p[i][0] != p[i + 1][0])
            cout << p[i][0] << ' ' << p[i][1] << ' ' << p[i + 1][0] << ' ' << p[i + 1][1] << '\n';
        else{
            cout << p[i][0] << ' ' << p[i][1] << ' ' << p[i + 1][2] << ' ' << p[i + 1][3] << '\n';
        }
    }
}




int main(){
    cin.tie(0); ios::sync_with_stdio(0);
    int T = 1, aa;
    // cin >> T;aa=T;
    while(T--){
        // cout << "Case #" << aa-T << ": ";
        solve();
        cout << '\n';
    }
    return 0;
 
}

Compilation message

roads.cpp: In function 'int main()':
roads.cpp:50:16: warning: unused variable 'aa' [-Wunused-variable]
   50 |     int T = 1, aa;
      |                ^~
# Verdict Execution time Memory Grader output
1 Failed 1 ms 212 KB Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])"
2 Halted 0 ms 0 KB -
# 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 2 ms 340 KB Output is correct
4 Correct 9 ms 1072 KB Output is correct
5 Correct 19 ms 1876 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 1108 KB Output is correct
5 Correct 21 ms 1872 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Failed 1 ms 340 KB Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])"
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 1 ms 396 KB Output is correct
4 Correct 8 ms 1104 KB Output is correct
5 Correct 15 ms 1876 KB Output is correct
6 Failed 1 ms 212 KB Condition failed: "pf == Sline.end() || !Cross(S[*pi], S[*pf])"
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 1 ms 212 KB Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 1 ms 212 KB Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])"
2 Halted 0 ms 0 KB -