Submission #857475

#TimeUsernameProblemLanguageResultExecution timeMemory
857475chilinhxyzabcCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int tryCombination(int s[]); void answer(int s[], int d[]); void exploreCave(int n) { int s[n], d[n]; for(int i = 0; i < n; i++) { s[i] = 1; d[i] = -1; } int curDoor = tryCombination(s); while(curDoor != -1) { int l = 0, r = n - 1, res = n - 1; while(l <= r) { int m = (l + r) / 2; s[m] = 1 - s[m]; int door = tryCombination(s); if(door == curDoor) { r = m - 1; } else { res = m; l = m + 1; } s[m] = 1 - s[m]; } d[res] = curDoor; s[res] = 1 - s[res]; curDoor = tryCombination(s); } for(int i = 0; i < n; i++) { if(d[i] != -1) continue; s[i] = 1 - s[i]; int door = tryCombination(s); d[i] = door; s[i] = 1 - s[i]; } answer(s, d); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccSJu19Z.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
/usr/bin/ld: /tmp/ccablJzY.o: in function `exploreCave(int)':
cave.cpp:(.text+0xf9): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x175): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x1b1): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x1e9): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x210): undefined reference to `answer(int*, int*)'
/usr/bin/ld: cave.cpp:(.text+0x24f): undefined reference to `tryCombination(int*)'
collect2: error: ld returned 1 exit status