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) {
string ans;
ans ="A";
int tot = press(ans);
if(tot != 1){
ans = "B";
tot = press(ans);
}
if(tot != 1){
ans = 'X';
tot = press(ans);
}
if(tot != 1){
ans = "Y";
tot = press(ans);
}
string ss = "ABXY";
for(int i = 1; i < N; i++){
int need = tot + 1;
for(int j = 0; j < 4; j++){
if(j == 0){
ans += ss[j];
tot = press(ans);
}
if(tot == need)break;
else if(j > 0){
ans[i] = ss[j];
tot = press(ans);
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |