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;
std::string guess_sequence(int N) {
int n=N;
int ans=press("AB");
string c;
string s="";
if (ans>0){
ans=press("A");
if (ans>0) c="ABXY";
else c="BAXY";
}
else{
ans=press("X");
if (ans==1) c="XABY";
else c="YABX";
}
s+=c[0];
for (int i=1;i<n-1;i++){
ans=press(s+c[1]+c[1]+s+c[1]+c[2]+s+c[1]+c[3]+s+c[2]);
if (ans==i) s+=c[3];
else if (ans==i+1) s+=c[2];
else s+=c[1];
}
if (n>1){
ans=press(s+c[1]);
if (ans==n) s+=c[1];
else{
ans=press(s+c[2]);
if (ans==n) s+=c[2];
else s+=c[3];
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |