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;
typedef long long ll;
std::string guess_sequence(int N) {
string s = "ABXY";
string S = "";
string t = "";
if(press("AB")){
if(press("A")){
S += s[0];
}
else{
S += s[1];
}
}
else{
if(press("X")){
S += s[2];
}
else{
S += s[3];
}
}
for(int i=0;i<4;i++){
if(S[(int)S.size()-1] == s[i]){
for(int j=0;j<4;j++){
if(s[j] != s[i]){
t += s[j];
}
}
}
}
for(int i=1;i<N-1;i++){
string st = S+t[0]+S+t[1]+t[0]+S+t[1]+t[1]+S+t[1]+t[2];
int p = press(st);
S += t[(p-i+2)%3];
}
if(press(S+t[0]+S+t[1]) == N){
if(press(S+t[0]) == N){
S += t[0];
}
else{
S += t[1];
}
}
else{
S += t[2];
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |