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 ans;
char a='A',b='B',c='Y';
if(press("XY")){
if(press("X"))
ans="X";
else{
ans="Y";
c='X';
}
}
else{
if(press("A")){
ans="A";
a='X';
}
else{
ans="B";
b='X';
}
}
for(int i = 2; i < n; i++){
int chu = press(ans+a+ans+b+a+ans+b+b+ans+b+c);
if(chu==i)
ans+=a;
else if(chu==i+1)
ans+=b;
else
ans+=c;
}
if(n>=2){
if(press(ans+a)==n)
ans+=a;
else if(press(ans+b)==n)
ans+=b;
else
ans+=c;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |