Submission #162641

#TimeUsernameProblemLanguageResultExecution timeMemory
162641demetreGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int n, a, b, f[10001][10001], fix[10001], p[10001]; int getcol (int l){ if (l == p[l]) return l; return getcol (p[l]); } void col (int k, int l){ int w = getcol(k); int u = getcol(l); p[w] = u; fix[u]+=fix[w]; fix[w] = 0; p[k] = l; for (int i = 0; i < n; i++){ f[u][i]+=f[w][i]; f[i][u]+=f[i][w]; } } int main (){ cin >> n; for (int i=0; i<n; i++){ p[i] = i; fix[i] = 1; } for (int i=1; i<=n*(n-1)/2; i++){ cin >> a >> b; a = getcol(a); b = getcol(b); f[a][b]++; f[b][a]++; if (f[a][b] == fix[a]*fix[b]){ cout << "YES" << endl; if (fix[a] >= fix[b]) swap(a, b); col (a, b); } else cout << "NO" << endl; } }

Compilation message (stderr)

/tmp/ccV9JMwh.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc6q57ie.o:game.cpp:(.text.startup+0x0): first defined here
/tmp/ccV9JMwh.o: In function `main':
grader.cpp:(.text.startup+0x14): undefined reference to `initialize(int)'
grader.cpp:(.text.startup+0x57): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status