# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313511 | Jarif_Rahman | 콤보 (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.
#include "mycombo.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
str guess_sequence(int n){
str s = "";
int r = 0;
while(n--){
int ab = press(s+"A"+s+"B");
int xy = press(s+"X"+s+"Y");
if(ab > r){
int a = press(s+"A");
int b = press(s+"B");
if(a > r){
s+="A";
r = a;
continue;
}
if(b > r){
s+="B";
r = b;
continue;
}
}
if(xy > r){
int x = press(s+"X");
int y = press(s+"Y");
if(x > r){
s+="X";
r = x;
continue;
}
if(y > r){
s+="Y";
r = y;
continue;
}
}
}
return s;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout << guess_sequence(5) << "\n";
}