Submission #168357

#TimeUsernameProblemLanguageResultExecution timeMemory
168357mat_vGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "game.h" //#define maxn using namespace std; int dsu[2505]; int vel[2505]; int ima[2505][2505]; vector<int> graf[2505]; bool bio[2505]; int bet[2505][2505]; int n; void init(){ for(int i=1; i<=n; i++){ dsu[i] = i; vel[i] = 1; } } int findpar(int x){ if(x == dsu[x])return x; return dsu[x] = findpar(dsu[x]); } int unite(int x, int y){ int a = findpar(x); int b = findpar(y); if(a == b){ return 0; } int uk = vel[a] * vel[b]; bet[a][b]++; bet[b][a]++; if(uk == bet[a][b]){ vel[a] += vel[b]; dsu[b] = a; for(int i=1; i<=n; i++){ bet[a][i] += bet[b][i]; bet[i][a] += bet[i][b]; } return 1; } return 0; } void dfs(int x){ bio[x] = 1; for(int i=1; i<=n; i++){ if(!bio[i]){ if(ima[x][i] != 2)dfs(i); } } } void probaj(int src){ for(int i=1; i<=n; i++)bio[i] = 0; dfs(src); } void initialize(int m) { n = m; init(); } int hasEdge(int u, int v) { u++; v++; return unite(u,v); } int main() { int a, b, c; cin >> a; //a = read_int(); initialize(a); for (int i = 0; i < n * (n - 1) / 2; i++) { //b = read_int(); //c = read_int(); cin >> b >> c; printf("%d\n", hasEdge(b, c)); } return 0; }

Compilation message (stderr)

/tmp/ccXl15Nt.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccdfmBu3.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status