Submission #510134

#TimeUsernameProblemLanguageResultExecution timeMemory
510134tabr콤보 (IOI18_combo)C++17
10 / 100
77 ms436 KiB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int press(string);

string guess_sequence(int n) {
    string t = "ABXY";
    int id = -1;
    for (int i = 0; i < 4; i++) {
        if (press(t.substr(i, 1))) {
            id = i;
        }
    }
    string res = t.substr(id, 1);
    for (int i = 1; i < n; i++) {
        res.push_back('A');
        for (int j = 0; j < 4; j++) {
            if (id == j) {
                continue;
            }
            res[i] = t[j];
            if (press(res) == i + 1) {
                break;
            }
        }
    }
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...