Submission #349720

#TimeUsernameProblemLanguageResultExecution timeMemory
349720PetyGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int n, sz[2000], p[2000], cnt[2000][2000]; int find (int x) { if (p[x] == x) return x; return p[x] = find(p[x]); } void Union (int x, int y) { if (x != y) { if (sz[x] < sz[y]) swap(x, y); for (int i = 1; i <= n; i++) cnt[i][x] += cnt[i][y]; p[y] = x; } return; } int intitialize(int m) { n = m; for (int i = 1; i <= n; i++) { sz[i] = 1; p[i] = i; for (int j = 1; j <= n; j++) cnt[i][j] = (i != j); } } int hasEdge (int x, int y) { x = find(x); y = find(y); if (x == y) return 0; if (cnt[x][y] > 1) return 0; return 1; }

Compilation message (stderr)

game.cpp: In function 'int intitialize(int)':
game.cpp:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
/tmp/ccXxAx70.o: In function `main':
grader.cpp:(.text.startup+0x14): undefined reference to `initialize(int)'
collect2: error: ld returned 1 exit status