제출 #1289985

#제출 시각아이디문제언어결과실행 시간메모리
1289985oruc콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include "combo.h"


string guess_sequence(int N){
    int ab = press("AB");
    int ax = press("AX");
    string ans;
    if(ab == 0){
        if(ax == 0){
            ans = "Y";
        }
        else if(ax == 1){
            ans = "X";
        }
        else{
            ans = "A";
        }
    }
    else if(ab == 1){
        if(ax == 0){
            ans = "B";
        }
        else if(ax == 1){
            ans = "A";
        }
        else{
            ans = "A";
        }
    }
    else{
        ans = "A";
    }

    char ilk = ans[0];
    for(int i = 2; i <= N; i++){
        for(char j: {'A','B','X','Y'}){
            if(j == ilk) continue;
            int ok = press(ans+j);
            if(ok == ans.size()+1){
                ans += j;
                break;
            }
        }
    }
    //cout << ans << endl;
    return ans;
}

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

combo.cpp:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string guess_sequence(int N){
      | ^~~~~~
      | stdin