# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1049193 | Jer | Combo (IOI18_combo) | C++17 | 30 ms | 848 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"
using namespace std;
string guess_sequence(int n)
{
string letters = "ABXY", start, curr, trial;
for (char x : letters)
{
start = x;
if (press(start) == 1)
{
break;
}
}
curr = start;
while ((int)curr.size() < n)
{
bool found_next_char = false;
for (char x : letters)
{
if (x == start[0])
continue;
trial = curr + x;
int res = press(trial);
if (res == (int)curr.size() + 1)
{
curr += x;
found_next_char = true;
break;
}
}
}
return curr;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |