# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023297 | vanea | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
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;
using ll = long long;
string guess_sequence(int n) {
string pos = "ABXY";
char beg;
for(auto it : pos) {
string s(n, it);
int k = press(s);
if(k == 1) beg = it;
}
string ans(n, beg);
int last = 1;
for(int i = 1; i < n; i++) {
for(auto it : pos) {
if(it == beg) continue;
ans[i] = it;
int curr = press(ans);
if(curr == last+1) break;
}
last++;
}
return ans;
}