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) {
vector<char> v = {'A', 'B', 'X', 'Y'};
string ans="";
for (char d : v) {
string ask="";
ask+=d;
if (press(ask) == 1) {
ans+=ask;
break;
}
}
int need=2;
for (int i = 1; i < N; ++i) {
for (char d : v) {
ans+=d;
if (press(ans)==need) {
++need;
break;
}
ans.pop_back();
}
}
// cout<<"CH "<<ans<<'\n';
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |