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 s , t = "ABXY";
string guess_sequence(int N) {
int ind = (press("XY") > 0) * 2 + (press("BY") > 0);
s += t[ind];
t = t.substr(0 , ind) + t.substr(ind + 1 , 10);
//cout << s << ' ' << t << ' ' << ind << endl;
for(int i = 1 ; i + 1 < N ; i++){
string query = s + t[0] + t[0] + s + t[0] + t[1] + s + t[0] + t[2] + s + t[1];
//cout << query << endl;
int ind = i + 2 - press(query);
s += t[ind];
}
int last = 0;
for(int i = 1 ; i < 3 ; i++){
if(press(s + t[i]) == N){
last = i;
}
}
s += t[last];
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |