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;
typedef long long LL;
string qu;
char c[10];
string guess_sequence(int n)
{
if(press(qu+'A'+'B')){
if(press(qu+'A'))qu+='A', c[1]='B', c[2]='X', c[3]='Y';
else qu+='B', c[1]='A', c[2]='X', c[3]='Y';
}
else{
if(press(qu+'X'))qu+='X', c[1]='B', c[2]='A', c[3]='Y';
else qu+='Y', c[1]='B', c[2]='X', c[3]='A';
}
for(int i=2; i<n; i++){
int temp=press(qu+c[1]+c[1]+qu+c[1]+c[2]+qu+c[1]+c[3]+qu+c[2]);
if(temp==i+1)qu+=c[1];
if(temp==i)qu+=c[2];
if(temp==i-1)qu+=c[3];
}
if(n!=1){
if(press(qu+c[1])==n)qu+=c[1];
else if(press(qu+c[2])==n)qu+=c[2];
else qu+=c[3];
}
return qu;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |