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;
char letras[3];
string guess_sequence(int N) {
string s = "";
if(press("AB") != 0){
if(press("A") == 1){
letras[0] = 'B';
letras[1] = 'X';
letras[2] = 'Y';
s+= 'A';
}else{
letras[0] = 'A';
letras[1] = 'X';
letras[2] = 'Y';
s+= 'B';
}
}else{
if(press("X") == 1){
letras[0] = 'B';
letras[1] = 'A';
letras[2] = 'Y';
s+= 'X';
}else{
letras[0] = 'B';
letras[1] = 'X';
letras[2] = 'A';
s+= 'Y';
}
}
int l = 1;
for(int i = 2; i < N; ++i){
int aux = press(s + letras[0] + letras[0] + s + letras[0] + letras[1] + s + letras[0] + letras[2] + s + letras[1]);
if(aux == l){
s+= letras[2];
}else{
if(aux - l == 1){
s+= letras[1];
}else{
s+= letras[0];
}
}
l++;
}
if(N > 1){
if(press(s + letras[0]) == N){
s+= letras[0];
}else{
if(press(s + letras[1]) == N){
s+= letras[1];
}else{
s+= letras[2];
}
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |