Submission #1129905

#TimeUsernameProblemLanguageResultExecution timeMemory
1129905pedreitorzeldaCombo (IOI18_combo)C++20
10 / 100
35 ms488 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
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 others(4*N,possible[j]);
                string q = others;
                int tmp = press(q);
                if(tmp>=i+1){
                    ans+=possible[j];
                    break;
                }
            }if(ans.size()==i)ans+=possible[3];
        }else{
            for(int j=0;j<3;j++){
                string others(4*N-i-1,ans[0]);
                string q = ans+possible[j]+others;
                int tmp = press(q);
                if(tmp>=i+1){
                    ans+=possible[j];
                    break;
                }
            }if(ans.size()==i)ans+=possible[3];
        }
        
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...