Submission #851820

#TimeUsernameProblemLanguageResultExecution timeMemory
851820ntkphongGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
//#include "game.h" #include <bits/stdc++.h> using namespace std; vector<int> par; vector<vector<int>> cnt; int N; int get_root(int u) { return u = par[u] ? u : par[u] = get_root(par[u]); } void initialize(int n) { par.resize(n); for(int i = 0; i < n; i ++) par[i] = i; cnt.resize(n, vector<int> (n, 1)); N = n; } int hasEdge(int u, int v) { u = par[u]; v = par[v]; if(u != v) { if(u > v) swap(u, v); cnt[u][v] -- ; if(!cnt[u][v]) { for(int i = 0; i < N; i ++) { if(i != par[i]) continue ; cnt[min(i, u)][max(i, u)] += cnt[min(i, v)][max(i, v)]; } par[v] = u; return 1; } } return 0; } int main() { int n; cin >> n; initialize(n); for(int i = 0; i < n * (n - 1) / 2; i ++) { int u, v; cin >> u >> v; cout << hasEdge(u, v) << "\n"; } return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccpxE52F.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvDzsOF.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status