# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162501 | abacaba | Combo (IOI18_combo) | C++14 | 55 ms | 648 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 <iostream>
#include <string>
#include <unordered_map>
#include <cstring>
#include <chrono>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <assert.h>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <deque>
#include <cassert>
#include <stack>
#include "combo.h"
using namespace std;
string seq[4] = {"A", "B", "X", "Y"};
int n, let1 = 3;
string guess_sequence(int N) {
int a = press(seq[0] + seq[1]);
int b = press(seq[1] + seq[2]);
if(!a && !b)
let1 = 3;
else if(a && b)
let1 = 1;
else if(a && !b)
let1 = 0;
else
let1 = 2;
string s = seq[let1];
swap(seq[3], seq[let1]);
if(N == 1)
return s;
for(int i = 2; i < N; ++i) {
string now = s + seq[0];
for(int j = 0; j < 3; ++j)
now += s + seq[1] + seq[j];
int p = press(now);
if(p == s.size())
s += seq[2];
else if(p == s.size() + 1)
s += seq[0];
else
s += seq[1];
}
for(int i = 0; i < 2; ++i)
if(press(s + seq[i]) == N)
return s + seq[i];
return s + seq[2];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |