# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
107241 | wonyoung | Combo (IOI18_combo) | C++14 | 77 ms | 436 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 <iostream>
#include <string>
using namespace std;
int press(string p);
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++)
{
if (s.length() > 0 && s[0] == buttons[i])
continue;
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;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |