Submission #1334368

#TimeUsernameProblemLanguageResultExecution timeMemory
1334368iamhereforfunCombo (IOI18_combo)C++20
10 / 100
16 ms456 KiB
// Starcraft 2 enjoyer //

#include <bits/stdc++.h>
#include "combo.h"

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")

using namespace std;

#define LSOne(X) ((X) & -(X))

const int N = 1e5 + 5;
const int M = 1e6 + 5;
const int LG = 60;
const int INF = 1e9 + 5;
const int K = 301;
const int B = 150000;
const int MOD = 1e9 + 7;
const char type[4] = {'A', 'B', 'X', 'Y'};

string guess_sequence(int n)
{
    string cur = "";
    for (int x = 0; x < 4; x++)
    {
        cur += type[x];
        int i = press(cur);
        if (i == 1)
        {
            break;
        }
        cur = "";
    }
    for (int x = 1; x < n; x++)
    {
        for (int y = 0; y < 4; y++)
        {
            if (type[y] == cur[0])
                continue;
            cur += type[y];
            int i = press(cur);
            if (i == x + 1)
            {
                break;
            }
            cur.pop_back();
        }
    }
    return cur;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...