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