# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
261463 | Valera_Grinenko | Combo (IOI18_combo) | C++17 | 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.
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include "combo.h"
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string guess_sequence(int n) {
string ans;
int st = press("XY");
if(st)
if(press("X")) ans = "X";
else ans = "Y";
else if(press("A")) ans = "A";
else ans = "B";
vector<char> ask(4); ask[0] = 'A'; ask[1] = 'B'; ask[2] = 'X'; ask[3] = 'Y';
ask.erase(find(all(ask), ans[0]));
for(int i = 1; i < n; i++) {
string query = ans + ask[0] + ans + ask[1] + ask[0] + ans + ask[1] + ask[1] + ans + ask[1] + ask[2];
int c = press(query);
if(c == ans.size()) ans += ans[2];
else if(c == ans.size() + 1) ans += ask[0];
else ans += ask[1];
}
return ans;
}
/*
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |