# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
928601 | AtabayRajabli | Combo (IOI18_combo) | C++17 | 37 ms | 1216 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 <bits/stdc++.h>
#include "combo.h"
std::string guess_sequence(int N)
{
std::string s = "";
std::string l = "ABXY";
for(int i = 0; i < 4; i++)
{
s += l[i];
if(press(s))break;
s.pop_back();
}
for(int i = 2; i <= N; i++)
{
for(int j = 0; j < 4; j++)
{
if(l[j] == s[0])continue;
std::string c = s;
while(c.size() < N)c += l[j];
if(press(c) > s.size())
{
s += l[j];
break;
}
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |