#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |