Submission #432125

#TimeUsernameProblemLanguageResultExecution timeMemory
432125MilosMilutinovicCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "code.h" #include <bits/stdc++.h> using namespace std; int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int N) { int combination[N]; for (int i = 0; i < N; i++) combination[i] = 0; bool locked[N]; for (int i = 0; i < N; i++) locked[i] = false; int position[N]; for (int i = 0; i < N; i++) { vector<int> positions; for (int j = 0; j < N; j++) if (!locked[j]) positions.push_back(j); int current = tryCombination(combination); bool is_correct = (current == -1 || current > i); if (!is_correct) { int bot = 0, top = (int) positions.size() - 1, pos = -1; while (bot <= top) { int mid = bot + top >> 1; for (int j = 0; j <= mid; j++) combination[positions[j]] ^= 1; int value = tryCombination(combination); if (value == -1 || value > i) pos = mid, bot = mid + 1; else top = mid - 1; for (int j = 0; j <= mid; j++) combination[positions[j]] ^= 1; } assert(pos != -1); combination[positions[pos]] = 1; locked[positions[pos]] = true; position[pos] = i; } else { int bot = 0, top = (int) positions.size() - 1, pos = -1; while (bot <= top) { int mid = bot + top >> 1; for (int j = 0; j <= mid; j++) combination[positions[j]] ^= 1; int value = tryCombination(combination); if (value == i) pos = mid, bot = mid + 1; else top = mid - 1; for (int j = 0; j <= mid; j++) combination[positions[j]] ^= 1; } assert(pos != -1); locked[positions[pos]] = true; position[pos] = i; } } answer(combination, position); }

Compilation message (stderr)

cave.cpp:1:10: fatal error: code.h: No such file or directory
    1 | #include "code.h"
      |          ^~~~~~~~
compilation terminated.