Submission #220000

#TimeUsernameProblemLanguageResultExecution timeMemory
220000BasilhijazCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <combo.h> string guess_sequence(int N) { string p = ""; string ans = ""; string opt = "ABXY"; int pos = -1; for(int i = 0; i < 3; i++){ p = ""; p += opt[i]; if(press(p) == 1){ ans += p; pos = i; break; } } if(pos == -1){ pos = 3; ans += opt[3]; } string ABX = ""; for(int i = 0; i < 4; i++){ if(i == pos)continue; ABX += opt[i]; } for(int i = 0; i < N - 2; i++){ p = ""; p += ans; p += ABX[0]; p += ans; p += ABX[1]; p += ABX[1]; p += ans; p += ABX[1]; p += ABX[0]; p += ans; p += ABX[1]; p += ABX[2]; int num = press(p); if(num == i + 1){ ans += ABX[2]; } else if(num == i + 2){ ans += ABX[0]; } else{ ans += ABX[1]; } } bool ok = 1; if(ans.size() == N) ok = 0; for(int i = 0; i < 2; i++){ p = ""; p += ans; p += ABX[i]; if(press(p) == N && ok){ ans += ABX[i]; ok = 0; break; } } if(ok){ ans += ABX[2]; } return ans; }

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