Submission #1174856

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11748562025-03-27 13:18:31trvhungCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include "cave.h"
void exploreCave(int N) {
int sw[N], fx[N], ofSw[N];
fill(fx, fx + N, -1);
for (int d = 0; d < N; ++d) {
for (int i = 0; i < N; ++i)
sw[i] = fx[i] == -1 ? 0 : fx[i];
int cur = tryCombination(sw);
int l = 0, r = N - 1;
while (l != r) {
int mid = (l + r) >> 1;
for (int i = l; i <= mid; ++i)
sw[i] = fx[i] == -1 ? 1 : fx[i];
int ask = tryCombination(sw);
for (int i = l; i <= mid; ++i)
sw[i] = fx[i] == -1 ? 0 : fx[i];
if (ask == cur)
l = mid + 1;
else
r = mid;
}
fx[l] = (cur == d);
ofSw[l] = d;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:5:9: error: 'fill' was not declared in this scope
    5 |         fill(fx, fx + N, -1);
      |         ^~~~