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 guess_sequence(int n)
{
string res;
int t=press("AB");
if(t==1) res+="BA"[press("A")];
else res+="YX"[press("X")];
string opt=res;
for(char c:"ABXY") if(c!=res[0]) opt+=c;
for(int i=2;i<=n-1;i++)
{
string now;
now+=res;
now+=opt[1];
for(int j=1;j<=3;j++) now+=(res+opt[2]+opt[j]);
t=press(now);
if(t==i-1) res+=opt[3];
else if(t==i) res+=opt[1];
else res+=opt[2];
}
for(int j=1;j<=3;j++)
{
if(j==3||press(res+opt[j])==n)
{
res+=opt[j];
break;
}
}
return res;
}
//int main()
//{
//
// return 0;
//}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |