Submission #1351925

#TimeUsernameProblemLanguageResultExecution timeMemory
1351925KALARRYCombo (IOI18_combo)C++20
0 / 100
0 ms412 KiB
//chockolateman

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

using namespace std;

char let[4] = {'A','B','X','Y'};

std::string guess_sequence(int N) 
{
    std::string p = "";
    for(int i = 0 ; i <= 3 ; i++)
    {
        p += let[i];
        int res = press(p);
        if(res >= i+1)
            break;
        p.pop_back();
    }
    for(int i = 1 ; i <= N-1 ; i++)
    {
        for(int k = 0 ; k <= 3 ; k++)
        {
            if(let[k] == p[0])
                continue;
            char c = let[k];
            p.push_back(c);
            int res = press(p);
            if(res >= i+1)
                break;
            p.pop_back();
        }
    }
    return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...