Submission #219959

#TimeUsernameProblemLanguageResultExecution timeMemory
219959BasilhijazCombo (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> string guess_sequence(int N) { std::string p = ""; string ans = ""; string opt = "ABXY"; int pos = 0; for(int i = 0; i < 4; i++){ p += opt[i]; if(press(p)){ ans += p; pos = i; break; } p = ""; } string Fopt = ""; for(int i = 0; i < 4; i++){ if(i == pos)continue; Fopt += opt[i]; } for(int i = 0; i < N - 1; i++){ p = ""; p += ans; p += Fopt[0]; p += ans; p += Fopt[1]; p += Fopt[1]; p += ans; p += Fopt[1]; p += Fopt[0]; p += ans; p += Fopt[1]; p += Fopt[2]; if(press(p) == ans.size()){ ans += Fopt[2]; } else if(press(p) == ans.size() + 1){ ans += Fopt[0]; } else{ ans += Fopt[1]; } } return ans; } int main(){ return 0; }

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