Submission #1049269

#TimeUsernameProblemLanguageResultExecution timeMemory
1049269MrDogMeatCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" string guess_sequence(int N) { string res = ""; vector<char> vec = {'A', 'B', 'X', 'Y'}; if(press("AB") >= 1) { if(press("A") == 1) { res += 'A'; vec.erase(vec.begin()); } else { res += 'B'; vec.erase(vec.begin() + 1); } } else { if(press("X") == 1) { res += 'X'; vec.erase(vec.begin() + 2); } else { res += 'Y'; vec.erase(vec.begin() + 3); } } for(int i = 2; i < N; i++) { string Try = res + vec[0] + res + vec[1] + vec[0] + res + vec[1] + vec[1] + res + vec[1] + vec[2]; int coins = press(Try); if(coins == i) res += vec[0]; else if(coins == i + 1) res += vec[1]; else res += vec[2]; } if(press(res + vec[0]) == N) res += vec[0]; else if(press(res + vec[1]) == N) res += vec[1]; else res += vec[2]; return res; }

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