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;
string guess_sequence(int N) {
int n = N;
vector<string> let = {"A", "B", "X", "Y"};
string ans = "";
if(press("AB")){
if(press("A")) ans = "A";
else ans = "B";
}else{
if(press("X")) ans = "X";
else ans = "Y";
}
let.erase(find(let.begin(), let.end(), ans));
for(int i = 1; i < n - 1; i ++){
int ask = press(ans + let[0] + ans + let[1] + let[0] + ans + let[1] + let[1] + ans + let[1] + let[2]);
if(ask == i){
ans += let[2];
}else
if(ask == i + 1)
ans += let[0];
else ans += let[1];
}
if(n != 1){
if(press(ans + let[0]) == n){
ans += let[0];
}else if(press(ans + let[1]) == n) ans += let[1]; else ans += let[2];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |