#include "combo.h"
std::string guess_sequence(int N) {
std::string p = "";
std::string temp = "ABXY";
std::string start = "";
int no;
for(int i=0;i<4;i++){
std::string s = "";
s+=temp[i];
if(press(s)==1){
start+=temp[i];
no = i;
break;
}
}
for(int i=1;i<N;i++){
for(int j=0;j<4;j++){
if(j == no) continue;
std::string temp2 = start;
temp2+=temp[j];
if(press(temp2) == i+1){
start = temp2;
break;
}
}
}
return start;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |