Submission #1202601

#TimeUsernameProblemLanguageResultExecution timeMemory
1202601okahak71Combo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include <bits/stdc++.h>
#include "combo.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define all(X) X.begin(), X.end()
#define allr(X) X.rbegin(), X.rend()
#define pb push_back
#define endl '\n'
using namespace std;
using namespace __gnu_pbds;

int press(string p);

string guess_sequence(int n){
    string res = "";
    ll cnt = 0;
    vector<char>ch = {'A', 'B', 'X', 'Y'};
    for(ll i = 0; i < 4; i++){
        res = ch[i];
        if(press(res)){
            ch.erase(ch.begin() + i);
            break;
        }
    }
    for(ll i = 0; i < n; i++){
        for(ll j = 0; j < 3; j ++){
            string temp = res + ch[j];
            if(press(temp) > cnt){
                res = temp;
                cnt++;
                break;
            }
        }
    }
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...