Submission #393455

#TimeUsernameProblemLanguageResultExecution timeMemory
393455peuchGondola (IOI14_gondola)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int MAXN = 1510; int N; int rep[MAXN], tam[MAXN]; int conect[MAXN][MAXN]; int find(int a){ if(rep[a] == a) return a; return rep[a] = find(rep[a]); } void uni(int a, int b){ a = find(a); b = find(b); if(tam[a] < tam[b]) swap(a, b); rep[b] = a; tam[a] += b; for(int i = 0; i < N; i++) conect[a][i] = conect[a][i] + conect[b][i], conect[i][a] = conect[a][i] + conect[b][i]; } void initialize(int n) { N = n; for(int i = 0; i < N; i++){ rep[i] = i; tam[i] = 1; for(int j = 0; j < N; j++) conect[i][j] = 1; conect[i][i] = 0; } } int hasEdge(int u, int v) { u = find(u), v = find(v); if(conect[u][v] == 1){ uni(u, v); return 1; } conect[u][v]--; conect[v][u]--; return 0; }

Compilation message (stderr)

/tmp/ccxY3WRb.o: In function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status