# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
107239 | wonyoung | 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 <string>
using namespace std;
string guess_sequence(int N)
{
const char buttons[4] = { 'A', 'B', 'X', 'Y' };
string s = "";
int i;
while (s.length() < N)
{
for (i=0; i<3; i++)
{
string query_string = "";
query_string.append(s);
query_string.push_back(buttons[i]);
int n = press(query_string);
if (n > s.length())
{
break;
}
}
s.push_back(buttons[i]);
}
return s;
}