# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085028 | Staheos | Combo (IOI18_combo) | C++14 | 63 ms | 856 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>
#include "combo.h"
#include <iostream>
using namespace std;
string guess_sequence(int N)
{
int ab = press("AB");
int xy = press("XY");
char first;
if (ab > 0)
{
if (press("A") > 0)
{
first = 'A';
}
else
{
first = 'B';
}
}
else
{
if (press("X") > 0)
{
first = 'X';
}
else
{
first = 'Y';
}
}
string p = "";
p += first;
for (int i = 1; i < N; i++)
{
p = p + 'A';
int m = press(p);
if (m > i)
{
continue;
}
p[i] = 'B';
m = press(p);
if (m > i)
{
continue;
}
p[i] = 'X';
m = press(p);
if (m > i)
{
continue;
}
p[i] = 'Y';
m = press(p);
if (m > i)
{
continue;
}
}
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |