Submission #372934

#TimeUsernameProblemLanguageResultExecution timeMemory
372934mariowongCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" string guess_sequence(int N) { string p,S; char f,s,t; if (press("AB") >= 1){ if (press("A") == 1) S+='A'; else S+='B'; } else { if (press("X") == 1) S+='X'; else S+='Y'; } for (int i = 2; i < N; i++){ p.clear(); if (S[0] == 'A'){ p+=S; p+='B'; p+=S; p+='X'; p+='X'; p+=S; p+='X'; p+='Y'; p+=S; p+='X'; p+='B'; f='B'; s='X'; t='Y'; } if (S[0] == 'B'){ p+=S; p+='A'; p+=S; p+='X'; p+='X'; p+=S; p+='X'; p+='Y'; p+=S; p+='X'; p+='A'; f='A'; s='X'; t='Y'; } if (S[0] == 'X'){ p+=S; p+='A'; p+=S; p+='B'; p+='B'; p+=S; p+='B'; p+='Y'; p+=S; p+='B'; p+='A'; f='A'; s='B'; t='Y'; } if (S[0] == 'Y'){ p+=S; p+='A'; p+=S; p+='B'; p+='B'; p+=S; p+='B'; p+='X'; p+=S; p+='B'; p+='A'; f='A'; s='B'; t='X'; } int ct=press(p); if (ct == i) S+=f; else if (ct == i-1) S+=t; else S+=s; } if (S[0] == 'A'){ p=S+'B'; if (press(p) == N) return p; p=S+'X'; if (press(p) == N) return p; p=S+'Y'; return p; } if (S[0] == 'B'){ p=S+'A'; if (press(p) == N) return p; p=S+'X'; if (press(p) == N) return p; p=S+'Y'; return p; } if (S[0] == 'X'){ p=S+'A'; if (press(p) == N) return p; p=S+'B'; if (press(p) == N) return p; p=S+'Y'; return p; } if (S[0] == 'Y'){ p=S+'B'; if (press(p) == N) return p; p=S+'X'; if (press(p) == N) return p; p=S+'A'; return p; } }

Compilation message (stderr)

combo.cpp:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string guess_sequence(int N) {
      | ^~~~~~
      | stdin