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>
using namespace std;
int a, b, c, d, e, n, m;
string s, t, st;
int press(string p);
string guess_sequence(int n) {
//int main() {
s="ABXY";
string yok="", p="";
for (a=0; a<3; a++)
{
string k;
k=k+s[a];
if (press(k)==1)
{
p=p+s[a];
break;
}
else
{
yok=yok+s[a];
}
}
if (p.length()==0) p=p+s[3]; else yok=yok+s[3];
for (a=2; a<=n-1; a++)
{
int k=press(p+yok[0]+yok[0]+p+yok[0]+yok[1]+p+yok[0]+yok[2]+p+yok[1]);
if (k==2) p=p+yok[0];
else if (k==1) p=p+yok[1];
else p=p+yok[2];
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |