#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string p , buttons = "ABXY";
string ans = "";
int coins = 0;
while(coins != N){
for(int i = 0 ; i < buttons.size() ;i++){
p = ans;
p += buttons[i];
if(p.size() > 1 and buttons[i] == p[0]) continue;
coins = press(p);
if(coins == p.size()){
ans = p;
break;
}
if(i == 2) {
p = ans;
p += buttons[3];
ans = p;
coins ++;
break;
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |