# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401558 | _DaNeK_ | Combo (IOI18_combo) | C++17 | 47 ms | 444 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>
using namespace std;
vector < char > m = {'A', 'B', 'Y', 'X'};
int press(string p);
string guess_sequence(int N)
{
string res = "";
int cur = 1, i = 0, first = 0;
while (i < 3 && press(res + m[i]) != cur)
++i;
res += m[i];
m.erase(m.begin() + i);
cur = 2;
while (res.size() < N)
{
int ind = 0, cnt = 0;
while (cnt < 2)
{
if (press(res + m[ind]) == cur)
break ;
++cnt;
++ind;
}
++cur;
res += m[ind];
}
return res;
}
/*int main ()
{
int n;
cin >> n;
cout << guess_sequence(n) << "\n";
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |