Submission #570640

#TimeUsernameProblemLanguageResultExecution timeMemory
570640kkkkkkkkCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> using namespace std; string guess_sequence(int N) { string rez; char prva; if (press("AB")) { if (press("A")) rez="A",prva='A'; else rez="B",prva='B'; } else { if (press("X")) rez="X",prva='X'; else rez="Y",prva='Y'; } for (int i=1;i<N;i++) { if (prva=='A') { if (press(rez+"B")==rez.size()+1) rez+="B"; else if (press(rez+"X")==rez.size()+1) rez+="X"; else rez+="Y"; } else if (prva=='B') { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"X")==rez.size()+1) rez+="X"; else rez+="Y"; } else if (prva=='X') { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"B")==rez.size()+1) rez+="B"; else rez+="Y"; } else { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"B")==rez.size()+1) rez+="B"; else rez+="X"; } } return rez; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if (press("AB"))
      |         ^~~~~
combo.cpp:28:17: error: 'press' was not declared in this scope
   28 |             if (press(rez+"B")==rez.size()+1)
      |                 ^~~~~
combo.cpp:37:17: error: 'press' was not declared in this scope
   37 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~
combo.cpp:46:17: error: 'press' was not declared in this scope
   46 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~
combo.cpp:55:17: error: 'press' was not declared in this scope
   55 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~