# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
85512 | JustasLe | 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.
/*input
9
1 2 3 7 6 5 5 2 6
*/
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
string ans = "";
string poss = "ABXY";
for (int i = 0; i < 4; i++) {
string temp = "" + poss[i];
int cnt = press(temp);
if (cnt > 0) {
poss.erase(poss.begin() + i);
ans += temp;
break;
}
}
bool ok = true;
int prev = 1;
while (ok) {
ok = false;
for (int i = 0; i < 3; i++) {
string newAns = ans + "" + poss[i];
int cnt = press(newAns);
if(cnt > prev) {
ans = newAns;
ok = true;
prev = cnt;
break;
}
}
}
return ans;
}
int main() {
return 0;
}