# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
993855 | voi | Combo (IOI18_combo) | C++17 | 23 ms | 2140 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>
#ifndef TANH
#include "combo.h"
#endif // TANH
using namespace std;
typedef long long ll;
const int ar = 2e5+2;
const ll mod = 1e9+7;
const int oo = 1e9;
#ifdef TANH
int main() {}
bool press(string a) {}
#endif // TANH
string guess_sequence(int n) {
string s = "", t;
if(press("AB")) {
if(press("A")) s += 'A', t = "BXY";
else s += 'B', t = "AXY";
}
else {
if(press("X")) s += 'X', t = "ABY";
else s += 'Y', t = "ABX";
}
if(s.size() == n) return s;
for(int i = 1; i < n - 1; ++i) {
string p = "";
p += s + t[0];
p += s + t[1] + t[0];
p += s + t[1] + t[1];
p += s + t[1] + t[2];
int x = press(p) - s.size();
if(x == 0) s += t[2];
else if(x == 1) s += t[0];
else s += t[1];
}
if(press(s + t[0]) == n) s += t[0];
else if(press(s + t[1]) == n) s += t[1];
else s += t[2];
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |