Submission #501312

#TimeUsernameProblemLanguageResultExecution timeMemory
501312shantolCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
string guess_sequence(int N){
    string a;
    string ex;
    for(int i=0;i<N;i++){
        if(!i){
            if(press("AB")){
                if(press("A"))a+="A";ex="BXY";
                else a+="B";ex="AXY";
            }
            else if(press("X"))a+="X";ex="ABY";
            else a+="Y";ex+="ABX";

        }
        else if(i==N-1){
            if(press(a+ex[0]))a+=ex[0];
            else if(press(ex[1]))a+=ex[1];
            else a+=ex[2];
        }
        else{
            int p=press(a+ex[0]+ex[0]+a+ex[0]+ex[1]+a+ex[0]+ex[2]+a+ex[1]);
            if(p==2)a+=ex[0];
            else if(p==1)a+=ex[1];
            else a+=ex[2];
        }
    }
    return a;
}

Compilation message (stderr)

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