Submission #585101

#TimeUsernameProblemLanguageResultExecution timeMemory
585101EinsiteinCave (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 y) -> void{ for (int i = l; i < y; 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:75:14: error: 'tryCombination' was not declared in this scope
   75 |         if ((tryCombination(guess.data()) + (n + 1)) % (n + 1) > i) {
      |              ^~~~~~~~~~~~~~
cave.cpp:88:27: error: 'tryCombination' was not declared in this scope
   88 |             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());
      |     ^~~~~~