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>
using namespace std;
int press(string p);
string guess_sequence(int n) {
vector<string> c={"A","B","X","Y"};
string ans="";
for (int i=0; i<4; i++) {
if (press(c[i])) {
ans+=c[i];
c.erase(c.begin()+i);
break;
}
}
int l=1;
while (l<n) {
for (auto i: c) {
if (press(ans+i)>l) {
ans+=i;
l++;
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |