| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1351636 | Omar_G | Combo (IOI18_combo) | C++20 | 0 ms | 420 KiB |
#include "combo.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef int ll;
typedef long double ld;
typedef string ss;
template<class T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define Omar_G ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(), x.end()
#define endl "\n"
random_device rd;
mt19937 mt(rd());
int rnd(int l, int r) {
return uniform_int_distribution<int>(l, r)(mt);
}
#define Y(x) ss((x) ? "Yes" : "No")
const ll mod = 676767677, inf = 5e18, N = 2e5 + 5, M = 500+5;
ss guess_sequence(ll n) {
ss c = "ABXY", s = "";
if (press("AB")) {
if (press("A")) swap(c[0], c[3]), s = "A";
else swap(c[1], c[3]), s = "B";
}
else {
if (press("X")) swap(c[2], c[3]), s = "X";
else s = "Y";
}
while (s.size() + 1 < n) {
ss q = s + c[0] + c[0] + s + c[0] + c[1] + s + c[0] + c[2] + s + c[1];
ll a = press(q);
if (a == s.size() + 2) s += c[0];
else if (a == s.size() + 1) s += c[1];
else s += c[2];
}
for (ll i = 0; i < 2; i++) {
if (press(s + c[i]) == n) {
return s+c[i];
}
}
return s + c[2];
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
