# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
894414 | AtabayRajabli | 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 "combo.h"
#include <bits/stdc++.h>
std::string guess_sequence(int N)
{
string p = "ABXY";
string res = "";
if(press("A"))res = "A";
else if(press("B"))res = "B";
else if(press("X"))res = "X";
else (press("Y"))res = "Y";
while(res.size() < N)
{
for(char c : p)
{
if(c == res[0])continue;
if(press(res + c) == res.size() + 1)
{
res += c;
break;
}
}
}
return res;
}