#include "combo.h"
#include<bits/stdc++.h>
using namespace::std;
string guess_sequence(int N) {
char l[]={'A','B','X','Y'};
string p = "AB";
int atb=press(p);
if(atb==0){
p="X";
atb=press(p);
if(atb==0) p="Y";
}else{
p="A";
atb=press(p);
if(atb==0) p="B";
}
for(int i=2; i<=N; i++){
p=p.substr(0,i-1)+"A"+p.substr(0,i-1)+"B";
atb=press(p);
if(atb==i-1){
p=p.substr(0,i-1)+"X";
atb=press(p);
if(atb==i-1) p=p.substr(0,i-1)+"Y";
}else{
p=p.substr(0,i-1)+"A";
atb=press(p);
if(atb==i-1) p=p.substr(0,i-1)+"B";
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |