Submission #891312

#TimeUsernameProblemLanguageResultExecution timeMemory
891312oblantisCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #define all(v) v.begin(), v.end() #define pb push_back #define ss second #define ff first #define vt vector using namespace std; //using namespace __gnu_pbds; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, int> pdi; const int inf = 1e9 + 10000; const int mod = 1e9+7; const int maxn = 5000 + 12; void explore_Cave(int n){ int s[n], d[n]; for(int i = 0; i < n; i++)s[i] = 0, d[i] = -1; int nd = n; int x = 0; while(nd){ int wt = tryCombination(s); vi dk; for(int j = 0; j < n; j++){ if(d[j] == -1){ if(wt == x)s[j] ^= 1; dk.pb(j); } } int l = 0, r = dk.size(); while(l + 1 < r){ int mid = l + (r - l) / 2; for(int i = l; i < mid; i++){ s[dk[i]] ^= 1; } wt = tryCombination(s); for(int i = l; i < mid; i++)s[dk[i]] ^= 1; if(wt == x)r = mid; else l = mid; } d[dk[l]] = x; nd--; x++; } answer(s, d); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccwozCJk.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status