Submission #623722

# Submission time Handle Problem Language Result Execution time Memory
623722 2022-08-06T12:23:21 Z Vladth11 Roads (CEOI20_roads) C++14
15 / 100
44 ms 7136 KB
#include <bits/stdc++.h>
#define C 1
#define P 0
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "

using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <long double, pii> muchie;

const ll NMAX = 100001;
const ll VMAX = 101;
const ll INF = (1LL << 60);
const ll MOD = 1000000007;
const ll BLOCK = 447;
const ll base = 117;
const ll nr_of_bits = 18;
const ll inv2 = 500000004;

map <pii, pii> mp;
pii v[NMAX * 2];

struct ura{
    pii a, b;
};

vector <ura> sol;
map <pii, bool> scutit;

int main() {
    //ifstream cin(".in");
    //ofstream cout(".out");
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, i;
    cin >> n;
    for(i = 1; i <= n; i++){
        pii a, b;
        cin >> a.first >> a.second >> b.first >> b.second;
        mp[a] = b;
        mp[b] = a;
        v[i * 2 - 1] = a;
        v[i * 2] = b;
    }
    sort(v + 1, v + n * 2 + 1);
    for(i = 1; i <= n * 2; i++){
        int j;
        if(scutit[v[i]]) continue;
        for(j = i - 1; j >= 1; j--){
            if(mp[v[i]] == v[j]) continue;
            break;
        }
        if(j == 0)
            continue;
        scutit[mp[v[i]]] = 1;
        sol.push_back({v[i], v[j]});
    }
    for(auto x : sol){
        cout << x.a.first << " " << x.a.second << " " << x.b.first << " " << x.b.second << "\n";
    }
    return 0;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Expected EOF
2 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 596 KB Output is correct
4 Correct 19 ms 3648 KB Output is correct
5 Correct 37 ms 7108 KB Output is correct
# 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 596 KB Output is correct
4 Correct 19 ms 3708 KB Output is correct
5 Correct 44 ms 7132 KB Output is correct
6 Correct 0 ms 340 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 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 18 ms 3744 KB Output is correct
5 Correct 37 ms 7136 KB Output is correct
6 Incorrect 0 ms 340 KB Expected EOF
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Expected EOF
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected EOF
2 Halted 0 ms 0 KB -