Submission #401526

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4015262021-05-10 12:55:38_DaNeK_Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
char m[4] = {'A', 'B', 'Y', 'X'};
int press(string p)
{
cout << p << "\n";
int a;
cin >> a;
return a;
}
string guess_sequence(int N)
{
string res = "";
int cur = 0, i = 0, first = 0;
while (i < 3 && press(res + m[i]) != cur + 1)
++i;
res += m[i];
first = i;
cur = 1;
while (res.size() < (unsigned int ) N)
{
int ind = 0, cnt = 0;
bool f = true;
while (cnt < 2 && f)
{
if (ind == first) continue ;
if (press(res + m[ind]) == cur + 1)
f = false;
if (f)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp:4:11: error: 'string' was not declared in this scope
    4 | int press(string p)
      |           ^~~~~~
combo.cpp:12:1: error: 'string' does not name a type
   12 | string guess_sequence(int N)
      | ^~~~~~