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 <bits/stdc++.h>
# include "combo.h"
using namespace std;
string t = "ABXY";
string guess_sequence(int N) {
string ans;
for(int i = 0; i < N; i ++){
string s;
s = ans + 'A' + ans + 'B';
int ret = press(s);
if(ret == i){
s = ans + 'X';
ret = press(s);
if(ret == i)
ans = ans + 'Y';
else
ans = ans + 'X';
} else {
s = ans + 'A';
ret = press(s);
if(ret == i)
ans = ans + 'B';
else
ans = ans + 'A';
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |