Submission #1275488

#TimeUsernameProblemLanguageResultExecution timeMemory
1275488abyfuCombo (IOI18_combo)C++20
5 / 100
1 ms400 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
#define pb push_back
#define ll long long
vector<string> rt;
int nn;
vector<char> mx = {'A', 'B', 'X', 'Y'};

void bt(string r, int u){
    if (u == nn){
        rt.pb(r);
    }
    else {
        for (int i = 0; i < 4; i++){
            bt(r + mx[i], u + 1);
        }
    }
}



string guess_sequence(int n){
    nn = n;
    if (n <= 3){
        bt("", 0);
        for (auto i : rt){
            if (press(i) == n){
                return i;
            }
        }
    }
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...