Submission #107238

#TimeUsernameProblemLanguageResultExecution timeMemory
107238wonyoungCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
using namespace std;

string guess_sequence(int N)
{
    const char buttons[4] = { 'A', 'B', 'X', 'Y' };
    string s = "";
    int i;
    while (s.length() < N)
    {
        for (i=0; i<3; i++)
        {
            string query_string = "";
            query_string.append(s);
            query_string.push_back(buttons[i]);
            int n = press(query_string);
            if (n > s.length())
            {
                break;
            }
        }
        s.push_back(buttons[i]);
    }

    return s;
}

Compilation message (stderr)

combo.cpp:3:1: error: 'string' does not name a type
    3 | string guess_sequence(int N)
      | ^~~~~~