Submission #1129897

#TimeUsernameProblemLanguageResultExecution timeMemory
1129897pedreitorzeldaCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
string guess_sequence(int N){
    string ans;
    vector<char>possible = {'A','B','X','Y'};
    for(int i=0;i<N;i++){
        if(i==0){
            for(int j=0;j<3;j++){
                string q(N,possible[j]);
                int tmp = press(q);
                if(tmp==1){
                    ans+=possible[j];
                    break;
                }
            }if(ans.size()==i)ans+=possible[3];
        }else{
            for(int j=0;j<3;j++){
                string q(N-i-1,ans[0]);
                string qu = ans+possible[j]+q;
                int tmp = press(qu);
                if(tmp==1){
                    ans+=possible[j];
                    break;
                }
            }if(ans.size()==i)ans+=possible[3];
        }
    }
    return ans;
}

Compilation message (stderr)

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