This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n) {
string p;
string S;
vector<char> let;
if(press("A")){
S+="A";
let.push_back('B');
let.push_back('X');
let.push_back('Y');
}else{
if(press("B")){
S+="B";
let.push_back('A');
let.push_back('X');
let.push_back('Y');
}else{
if(press("X")){
S+="X";
let.push_back('A');
let.push_back('B');
let.push_back('Y');
}else{
S+="Y";
let.push_back('A');
let.push_back('B');
let.push_back('X');
}
}
}
for(int i=2; i<=n; i++){
bool guessed=false;
for(int j=0; j<2; j++){
char c=let[j];
if(press(S+c)==i){
S+=c;
guessed=true;
break;
}
}
if(!guessed){
S+=let[2];
}
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |