Submission #650728

#TimeUsernameProblemLanguageResultExecution timeMemory
650728erkeCombo (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { vector<char> v = {'A', 'B', 'X', 'Y'}; string ret; if (press("AB")) { if (press("A")) { ret += 'A'; swap(v[0], v[3]); } else { ret += 'B'; swap(v[1], v[3]); } } else { if (press("X")) { ret += 'X'; swap(v[2], v[3]); } else { ret += 'Y'; // swap(v[3], v[3]); } } while ((int) ret.size() < n - 1) { string tmp = ret + v[0]; for (int i = 0; i < 3; i++) { tmp += ret + v[1] + v[i]; } int p = press(tmp); if (p == (int) ret.size() + 1) { ret += v[0]; } else if (p == (int) ret.size() + 2) { ret += v[1]; } else { ret += v[2]; } } if (press(ret + v[0]) == n) { ret += v[0]; } else if (press(ret + v[1]) == n) { ret += v[1]; } else { ret += v[2]; } return ret; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:9: error: 'press' was not declared in this scope
    7 |     if (press("AB")) {
      |         ^~~~~
combo.cpp:32:17: error: 'press' was not declared in this scope
   32 |         int p = press(tmp);
      |                 ^~~~~
combo.cpp:43:9: error: 'press' was not declared in this scope
   43 |     if (press(ret + v[0]) == n) {
      |         ^~~~~