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;
char cc[]="ABXY";
string c;
string guess_sequence(int N) {
string p, 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;
for(int i=0; i<4; ++i)
if(cc[i]!=S[0])c += cc[i];
for(int i=1; i<N-1; ++i){
p = "";
for(int j=0; j<3; ++j)
p += S+c[0]+c[j];
p += S+c[1];
int t = press(p)-i;
if(t == 2)S += c[0];
else if(t)S += c[1];
else S += c[2];
}
if(press(S+c[0])==N) S += c[0];
else if(press(S+c[1])==N) S += c[1];
else S += c[2];
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |