# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
143735 | | yum | 콤보 (IOI18_combo) | C++14 | | 1 ms | 200 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"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<long long, long long> pl;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double EPS = 1e-6;
string guess_sequence(int N) {
vector<char> but = {'A', 'B', 'X', 'Y'};
string ans;
if (press("AB") >= 1) ans = press("A") ? "A" : "B";
else ans = press("X") ? "X" : "Y";
but.erase(find(but.begin(), but.end(), but[0]));
for (int i = 1; i < N; ++i) {
int res = press(ans + but[0] + ans + but[1] + but[0] + ans + but[1] + but[1] + ans + but[1] + but[2]);
if (res == 0) ans += but[2];
else if (res == 1) ans += but[0];
else ans += but[1];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |