Submission #583088

#TimeUsernameProblemLanguageResultExecution timeMemory
583088Mystic03Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <vector> #include <algorithm> #include <string> using namespace std; std::string guess_sequence(int N) { string p = ""; char c; vector<char> possible{ 'A', 'B', 'X', 'Y' }; if (press("A")) { p.push_back('A'); possible.erase(possible.begin() + 0); } else if (press("B")) { p.push_back('B'); possible.erase(possible.begin() + 1); } else if (press("X")) { p.push_back('X'); possible.erase(possible.begin() + 2); } else{ p.push_back('Y'); possible.erase(possible.begin() + 3); } for (int i = 1; i < N; i++) { for (char c : possible) { p.push_back(c); if (press(p) > i) break; p.pop_back(); } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:6: error: 'press' was not declared in this scope
   10 |  if (press("A")) {
      |      ^~~~~
combo.cpp:29:8: error: 'press' was not declared in this scope
   29 |    if (press(p) > i) break;
      |        ^~~~~
combo.cpp:8:7: warning: unused variable 'c' [-Wunused-variable]
    8 |  char c;
      |       ^