# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430719 | albertolg101 | Combo (IOI18_combo) | C++17 | 37 ms | 620 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"
using namespace std;
using ll = long long;
string f (string s, string &d)
{
string ans;
return ans;
}
string guess_sequence(int N)
{
string ans, d;
int r = press("AB");
if(r)
{
r = press("A");
ans = (r ? "A" : "B");
d = "XY";
d += (r ? "B" : "A");
}
else
{
r = press("X");
ans = (r ? "X" : "Y");
d = "AB";
d += (r ? "Y" : "X");
}
for(int i = 1 ; i < N - 1 ; i++)
{
string q = ans + d[0] + d[1] + ans + d[0] + d[2] + ans + d[0] + d[0] + ans + d[1];
r = press(q);
if(r == ans.size())
ans += d[2];
else if(r == ans.size() + 1)
ans += d[1];
else
ans += d[0];
}
if(N > 1)
{
int r1 = press(ans + d[0]),
r2 = press(ans + d[1]);
if(r1 > r2)
ans += d[0];
else if(r1 < r2)
ans += d[1];
else
ans += d[2];
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |