# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1082228 | raphael_heuchl | Combo (IOI18_combo) | C++14 | 1 ms | 344 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"
std::string guess_sequence(int N)
{
std::string ans = "A";
if (press("B"))
ans = "B";
else if (press("X"))
ans = "X";
else if (press("Y"))
ans = "Y";
std::string s = "";
for (char c : (std::string)"ABXY")
if (c != ans[0])
s += c;
std::string guess;
while (ans.size() < N - 1)
{
guess = ans + s[0] + \
ans + s[1] + s[0] + \
ans + s[1] + s[1] + \
ans + s[1] + s[2];
if (press(guess) == ans.size())
ans += s[2];
else if (press(guess) == ans.size() + 1)
ans += s[0];
else
ans += s[1];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |