Submission #468088

#TimeUsernameProblemLanguageResultExecution timeMemory
468088jjjCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
std::string guess_sequence(int N) { std::string p = ""; std::string s = "", a = "", b = "", c = ""; int coins = press("AB"); if(coins == 1) { coins = press("A"); if(coins == 1) { s += 'A'; a += 'B'; b += 'X'; c += 'Y'; } else { s += 'B'; a += 'A'; b += 'X'; c += 'Y'; } } else { coins = press("X"); if(coins == 1) { s += 'X'; a += 'B'; b += 'A'; c += 'Y'; } else { s += 'Y'; a += 'B'; b += 'X'; c += 'A'; } } for (int i = 0; i < N; i++) { p = s + a + a + s + a + b + s + a + c + s + b; coins = press(p); if(coins == 0) s += c; if(coins == 1) s += b; if(coins == 2) s += a; } if(press(s + a) == 1) s += a; else if(press(s + b) == 1) s += b; else if(press(s + c) == 1) s += c; return s; }

Compilation message (stderr)

combo.cpp:1:6: error: 'string' in namespace 'std' does not name a type
    1 | std::string guess_sequence(int N) {
      |      ^~~~~~
combo.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 | std::string guess_sequence(int N) {