# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1194590 | ahmetlbktd4 | 콤보 (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n){
string s = "";
int p[3] = {0,1,2};
lab:if (p[0] > 3){
return "";
}
for (int i = 2;i > 0;i--){
if (p[i] > 3){
p[i] = 1;p[i-1]++;goto lab;
}
}
for (int i = 1;i < 3;i++){
if (p[i] == p[0])
goto label;
}
for (int i = 0;i < 3;i++){
if (p[i] == 0)
s+="A";
if (p[i] == 1)
s+="B";
if (p[i] == 2)
s+="X";
if (p[i] == 3)
s+="Y";
}
int h = press(s);
if (h == n){
return s;
}
label:p[2]++;goto lab;
}