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) {
string m;
std::string p = "";
std::string S = "";
int t;
t=press("AB");
if(t){
t=press("A");
if(t){S+="A";m="BXY";}
else {S+="B";m="AXY";}
}
else{
t=press("X");
if(t){S+="X";m="ABY";}
else {S+="Y";m="ABX";}
}
if(N==1)return S;
for(int i=0;i<N-2;i++){
t=press(S+m[0]+S+m[1]+m[0]+S+m[1]+m[1]+S+m[1]+m[2]);
if(t==i+1)S+=m[2];
else if(t==i+2)S+=m[0];
else S+=m[1];
}
t=press(S+m[0]);
if(t==N)S+=m[0];
else if(press(S+m[1])==N)S+=m[1];
else S+=m[2];
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |