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;
string guess_sequence(int N){
string S;
if (press("AB"))
S+='A'+press("B");
else
S+='X'+press("Y");
if (N==1)
return S;
string b="ABXY",c;
for (char i:b)
if (i!=S[0])
c+=i;
for (int i=1;i<N-1;i++){
int val=press(S+c[0]+S+c[1]+c[0]+S+c[1]+c[1]+S+c[1]+c[2]);
if (val==i+1)
S+=c[0];
else if (val==i+2)
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... |