Submission #1203897

#TimeUsernameProblemLanguageResultExecution timeMemory
1203897andrejikusCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "cave.h" using namespace std; typedef long long ll; void DBG() { cerr << "]" << endl; } template<class H, class... T> void DBG(H h, T... t) { cerr << to_string(h); if(sizeof...(t)) cerr << ", "; DBG(t...); } #define dbg(...) cerr << "[" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__) const int N = 5003; int s[N], d[N]; int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int n) { for (int i = 0; i < n; i++) d[i] = -1; auto ok = [&](int l, int r) { for (int k = l; k <= r; k++) { if (d[k] != -1) continue; s[k] = 0; } int x = tryCombination(s); for (int k = l; k <= r; k++) { if (d[k] != -1) continue; s[k] = 1; } int y = tryCombination(s); return (x != y); }; for (int i = 0; i < n; i++) { int low = 0, high = n-1; while (low < high) { int mid = (low + high) / 2; if (ok(low, mid)) high = mid; else low = mid+1; } d[i] = low; s[i] = 0; int x = tryCombination(s); if (x == low) s[i] = 1; } answer(s, d); } int main() { int N = 3; exploreCave(N); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cctIwvgX.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/cctCLyFo.o:cave.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cctCLyFo.o: in function `exploreCave(int)':
cave.cpp:(.text+0x169): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x19f): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x1cb): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x22c): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x212): undefined reference to `answer(int*, int*)'
/usr/bin/ld: /tmp/cctIwvgX.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status