#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N){
string s;
string g = "ABXY";
char ign = 'A';
for(int i = 0; i < 3; i++){
string h;
h += g[i];
if(press(h) == 1){
s += h;
ign = g[i];
break;
}
}
if(s == ""){
ign = g[3];
s += ign;
}
string gg;
for(char ch:g){
if(ch == ign)continue;
gg += ch;
}
g = gg;
for(int i = 2; i < N; i++){
string p = s + g[0] + s + g[1] + g[0] + s + g[1] + g[1] + s + g[1] + g[2];
if(press(p) == i){
s += g[0];
}
else if(press(p) == i + 1){
s += g[1];
}
else{
s += g[2];
}
}
for(int i = 0; i < 2; i++){
if(press(s + g[i]) == N){
return s + g[i];
}
}
return s + g[2];
}
/*
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |