# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
648087 | Kenpar | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//OJUZ grind baby
#include "bits/stdc++.h"
using namespace std;
#define ll long long
char word[] = {'A', 'B', 'X', 'Y'};
string nextPermutation(string p, int N){
if(p.length() == N){
return ((press(p) == N)?p:"");
}else{
string ans = "";
for(int i = 0; i < 4; i++){
string temp = p + word[i];
temp = nextPermutation(temp, N);
if(temp.length() > ans.length()){
ans = temp;
}
}
return ans;
}
}
string guess_sentence(int N){
return nextPermutation("", N);
}