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;
#define PB push_back
typedef vector<int> vec;
string guess_sequence(int N){
string s="";
char a,b,c,d;
if(press("AB")>0){
if(press("A")==1){
a='A';b='B';c='X';d='Y';
}else{
a='B';b='A';c='X';d='Y';
}
}else{
if(press("X")==1){
a='X';b='B';c='A';d='Y';
}else{
a='Y';b='B';c='X';d='A';
}
}
s+=a;
for(int l=1;l<N-1;l++){
int coin=press(s+c+s+d+b+s+d+c+s+d+d);
if(coin==l){
s+=b;
}else{
if(coin==l+1){
s+=c;
}else{
s+=d;
}
}
}
if(N>1){
int coin=press(s+b+s+c);
if(coin==N){
if(press(s+b)==N){
s+=b;
}else{
s+=c;
}
}else{
s+=d;
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |