Submission #1038507

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10385072024-07-29 21:36:46attkyCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int n) {
int state[n], pos[n];
bool good[n];
for(int loop = 0; loop < n; ++loop) {
good[loop] = false;
pos[loop] = -1;
}
for(int loop = 0; loop < n; ++loop) {
for(int looping = 0; looping < n; ++looping) {
if(!good[looping]) {
state[looping] = 1;
}
}
int ans = tryCombination(state)-1;
if(ans < 0) {
ans = 2e9;
}
bool closed = (ans == loop);
int deb = 0, fin = n-1;
while(fin-deb > 0) {
int mid = (deb+fin)/2;
for(int looping = mid+1; looping <= fin; ++looping) {
if(!good[looping]) {
state[looping] = 1-state[looping];
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:19: error: 'tryCombination' was not declared in this scope
   18 |         int ans = tryCombination(state)-1;
      |                   ^~~~~~~~~~~~~~
cave.cpp:46:5: error: 'answer' was not declared in this scope
   46 |     answer(state, pos);
      |     ^~~~~~