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"
std::string guess_sequence(int N) {
std::string ans = "";
for(int i = 0; i < N; ++i){
std::string ab = ans + "A";
for(int j = 0; j < N; ++j){
ab += "A";
}
ab += ans + "B";
int curab = press(ab);
if(curab == i + 1){
int a = press(ans + "A");
if(a == i + 1){
ans += "A";
}
else ans += "B";
} else{
int x = press(ans + "X");
if(x == i + 1){
ans += "X";
}
else ans += "Y";
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |