# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897349 | honanhphong | Combo (IOI18_combo) | C++17 | 38 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 <bits/stdc++.h>
#include "combo.h"
#define pb push_back
#define fi first
#define se second
#define faster ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
using lli = long long;
using ld = long double;
using pii = pair <int, int>;
mt19937_64 Rand(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 1e6 + 1000;
const int mod = 1e9 + 7;
int press(string p);
string guess_sequence(int N)
{
string s = "";
string p = "ABXY";
char start;
char cs[maxn];
if (press("AB"))
{
if (press("A"))
{
s += 'A';
start = 'A';
} else
{
s += 'A';
start = 'A';
}
} else
{
if (press("X") == 1)
{
s += 'X';
start = 'X';
} else
{
s += 'Y';
start = 'Y';
}
}
if (start == 'A')
{
cs[0] = 'B'; cs[1] = 'X'; cs[2] = 'Y';
} else if (start == 'B')
{
cs[0] = 'A'; cs[1] = 'X'; cs[2] = 'Y';
} else if (start == 'X')
{
cs[0] = 'A'; cs[1] = 'B'; cs[2] = 'Y';
} else if (start == 'Y')
{
cs[0] = 'A'; cs[1] = 'B'; cs[2] = 'X';
}
while (s.length() < N)
{
for (char c : p)
{
if (c == start) continue;
if (press(s + c) == s.size() + 1)
{
s += c;
break;
}
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |