Submission #1021369

# Submission time Handle Problem Language Result Execution time Memory
1021369 2024-07-12T17:20:20 Z Wael Fountain Parks (IOI21_parks) C++17
Compilation error
0 ms 0 KB
#include "parks.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;

int construct_roads(vector<int> x, vector<int> y) {
    int n = x.size();

    int N = 2e5;
    vector<map<int, int>> id(N + 1);

    for (int i = 0; i < n; ++i) {
        id[x[i]][y[i]] = i;
    }

    int cnt = 0;
    vector<int> u, v, a, b;
    for (int i = 0; i < n; ++i) {
        if (id[x[i]].count(y[i] + 2)) {
            u.push_back(i);
            v.push_back(id[x[i]][y[i] + 2]);
            a.push_back(x[i] + 1);
            b.push_back(y[i] + 1);
            ++cnt;
        }
    }

    if (cnt == n - 1) {
        build(u, v, a, b);
        return 1;
    }
    return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccctppSV.o: in function `build(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x270): multiple definition of `build(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'; /tmp/ccTMlJYV.o:parks.cpp:(.text+0x440): first defined here
/usr/bin/ld: /tmp/ccctppSV.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccTMlJYV.o:parks.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status