Submission #699498

#TimeUsernameProblemLanguageResultExecution timeMemory
699498khshgCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { vector<string> v = {"X", "Y", "A", "B"}; string ans; if(press(v[0] + v[1])) { if(press(v[0])) { ans = v[0]; } else { ans = v[1]; } } else { if(press(v[2])) { ans = v[2]; } else { ans = v[3]; } } v.erase(find(begin(v), end(v), ans)); for(int i = 2; i < N; ++i) { ans += v[i + 1 - press(ans + v[0] + v[0] + ans + v[0] + v[1] + ans + v[0] + v[2] + ans + v[1])]; } if(press(ans + v[0] + ans + v[1]) == N) { if(press(ans + v[0]) == N) { ans += v[0]; } else { ans += v[1]; } } else { ans += v[2]; } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:5: error: 'press' was not declared in this scope
    7 |  if(press(v[0] + v[1])) {
      |     ^~~~~
combo.cpp:22:20: error: 'press' was not declared in this scope
   22 |   ans += v[i + 1 - press(ans + v[0] + v[0] + ans + v[0] + v[1] + ans + v[0] + v[2] + ans + v[1])];
      |                    ^~~~~
combo.cpp:24:5: error: 'press' was not declared in this scope
   24 |  if(press(ans + v[0] + ans + v[1]) == N) {
      |     ^~~~~