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 "combo.h"
#include<bits/stdc++.h>
using namespace std;
vector<string> v;
string guess_sequence(int N) {
string s="";
if(press("AB")){
if(press("A")) s="A";
else s="B";
}
else{
if(press("X")) s="X";
else s="Y";
}
if(N==1) return s;
if(s[0]!='A') v.push_back("A");
if(s[0]!='B') v.push_back("B");
if(s[0]!='X') v.push_back("X");
if(s[0]!='Y') v.push_back("Y");
for(int i=2;i<=N-1;i++){
string temp=s+v[2]+v[0]+s+v[2]+v[1]+s+v[2]+v[2]+s+v[1];
int ind=press(temp)-s.size();
s+=v[ind];
}
if(press(s+"A"+s+"B")==N){
if(press(s+"A")==N) s+="A";
else s+="B";
}
else{
if(press(s+"X")==N) s+="X";
else s+="Y";
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |