Submission #401577

#TimeUsernameProblemLanguageResultExecution timeMemory
401577_DaNeK_Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector < char > m = {'A', 'B', 'Y', 'X'}; int press(string p) string guess_sequence(int N) { string res = ""; int tmp = press("AB"); if (tmp > 1) { if (press("A")) { res = "A"; m.erase(m.begin()); } else { res = "B"; m.erase(m.begin() + 1); } } else { if (press("X")) { res = "X"; m.erase(m.begin() + 3); } else { res = "Y"; m.erase(m.begin() + 2); } } if (N == 1) return res; int cur = 2; while (res.size() < N - 1) { string s = res + m[0] + res + m[1] + m[0] + res + m[1] + m[1] + res + m[1] + m[2]; int tmp = press(s); if (tmp == cur - 1) res += m[2]; else { if (tmp == cur) res += m[0]; else res += m[1]; } ++cur; } if (press(res + m[0]) == cur) res += m[0]; else if (press(res + m[1]) == cur) res += m[1]; else res += m[2]; return res; }

Compilation message (stderr)

combo.cpp:9:1: error: expected initializer before 'string'
    9 | string guess_sequence(int N)
      | ^~~~~~