# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216631 | achvanov | Combo (IOI18_combo) | C++17 | 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>
#include <combo.h>
using namespace std;
char c[] = {'A', 'B', 'X', 'Y'};
string guess_sequence(int n) {
string res = "";
for (int k = 0; k < 4; ++k) {
res.clear();
res += c[k];
for (int i = 1; i < n; ++i) {
ok = false;
for (int j = 0; j < 4; ++j) {
if (k != j and press(res + c[j]) > res.size()) {
res += c[j];
ok = true;
break;
}
}
if (!ok) {
break;
}
}
if (res.size() == n) {
return res;
}
}
}