# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1124684 | ZyadH1 | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
string p , buttons = "ABXY";
string ans + "";
while(1){
for(int i = 0 ; i < 4 ;i++){
p = ans;
p += buttons[i];
if(p.size() > 1 and buttons[i] == p[0]) continue;
int coins = press(p);
if(coins == p.size()){
ans = p;
}
if(coins == N) break;
}
}
return ans;
}