Submission #585110

#TimeUsernameProblemLanguageResultExecution timeMemory
585110EinsiteinCave (IOI13_cave)C++98
Compilation error
0 ms0 KiB
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> using namespace std; void exploreCave(int N) { vector<int> s(N); vector<int> d(N); vector<int> guess(N, 0); vector<bool> done(N, 0); auto toggle = [&](int l, int r) -> void { for (int i = l; i < r; i++) { if (!done[i]) guess[i] ^= 1; } }; for (int i = 0; i < N; i++) { int lower = 0, higher = N; bool last; if ((tryCombination(guess.data()) + (N + 1)) % (N + 1) > i) { last = true; } else { last = false; } while (higher > lower + 1) { int mid = (lower + higher) * 0.5; toggle(lower, mid); if (last == ((tryCombination(guess.data()) + (N + 1)) % (N + 1) > i)) { lower = mid; } else { last = !last; higher = mid; } } s[lower] = last ^ guess[lower] ^ 1; d[lower] = i; done[lower] = 1; guess[lower] = s[lower]; } answer(s.data(), d.data()); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:78:14: error: 'tryCombination' was not declared in this scope
   78 |         if ((tryCombination(guess.data()) + (N + 1)) % (N + 1) > i) {
      |              ^~~~~~~~~~~~~~
cave.cpp:89:27: error: 'tryCombination' was not declared in this scope
   89 |             if (last == ((tryCombination(guess.data()) + (N + 1)) % (N + 1) > i))
      |                           ^~~~~~~~~~~~~~
cave.cpp:106:5: error: 'answer' was not declared in this scope
  106 |     answer(s.data(), d.data());
      |     ^~~~~~