Submission #813305

#TimeUsernameProblemLanguageResultExecution timeMemory
813305PikachuCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <stdio.h> #include <stdbool.h> int tryCombination(int S[]); void answer(int S[], int D[]); const int maxn = 5010; void reverse(int l, int r, bool done[], int S[]) { for (int i = l; i <= r; i++) { if (!done[i]) S[i] = !S[i]; } } void exploreCave(int n) { int S[maxn], D[maxn]; bool done[maxn]; for (int i = 0; i < n; i++) { if (tryCombination(S) == i) reverse(0, n - 1, done, S); int l = 0; int r = n - 1; while (l < r) { int mid = (l + r) >> 1; reverse(l, mid, done, S); if (tryCombination(S) == i) { r = mid; } else l = mid + 1; reverse(l, mid, done, S); } done[l] = true; D[l] = i; } answer(S, D); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccJGiIE0.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
/usr/bin/ld: /tmp/cc0ALpV0.o: in function `exploreCave(int)':
cave.cpp:(.text+0xb4): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x12c): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x176): undefined reference to `answer(int*, int*)'
/usr/bin/ld: cave.cpp:(.text+0x1e4): undefined reference to `tryCombination(int*)'
collect2: error: ld returned 1 exit status