Submission #538225

#TimeUsernameProblemLanguageResultExecution timeMemory
538225EZiganshin콤보 (IOI18_combo)C++17
30 / 100
82 ms592 KiB
#include "combo.h"
#include <bits/stdc++.h>

#include <random>

using namespace std;

const int K = 4;

vector<string> key = {"A", "B", "X", "Y"};

string get_string(vector<int> &a) {
    string res;
    for (int x: a) {
        res += key[x];
    }
    return res;
}

int n;

string guess_sequence(int N) {
    n = N;
    string s;
    for (int i = 0; i < n; i++) {
        shuffle(key.begin(), key.end(), std::mt19937(std::random_device()()));
        if (press(s + key[0] + s + key[1]) >= i + 1) {
            if (press(s + key[0]) == i + 1) {
                s += key[0];
            } else {
                s += key[1];
            }
        } else {
            if (press(s + key[2]) == i + 1) {
                s += key[2];
            } else {
                s += key[3];
            }
        }
    }
    return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...