제출 #107237

#제출 시각아이디문제언어결과실행 시간메모리
107237wonyoungCombo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB

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;
}

컴파일 시 표준 에러 (stderr) 메시지

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