# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007083 | makanhulia | 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.
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
// #define int long long
// #define fi first
// #define se second
// #define pb push_back
string guess_sequence(int n){
string s = "";
int tmp = press("AB");
if(tmp >= 1){
tmp = press("A");
if(tmp == 1){
s += 'A';
}
else s += 'B';
}
else{
tmp = press("X");
if(tmp == 1){
s += 'X';
}
else s += 'Y';
}
while(1){
if(s[0] == 'X'){
tmp = press(s + 'B' + s + "AA" + s + "AY" + s + "AB");
if(tmp == s.length() + 1){
s += 'B';
}
else if(tmp == s.length() + 2){
s += 'A';
}
else s += 'Y';
}
if(s[0] == 'Y'){
tmp = press(s + 'B' + s + "AA" + s + "AX" + s + "AB");
if(tmp == s.length() + 1){
s += 'B';
}
else if(tmp == s.length() + 2){
s += 'A';
}
else s += 'X';
}
if(s[0] == 'A'){
tmp = press(s + 'B' + s + "XY" + s + "XX" + s + "XB");
if(tmp == s.length() + 1){
s += 'B';
}
else if(tmp == s.length() + 2){
s += 'X';
}
else s += 'Y';
}
if(s[0] == 'B'){
tmp = press(s + 'A' + s + "XY" + s + "XX" + s + "XA");
if(tmp == s.length() + 1){
s += 'A';
}
else if(tmp == s.length() + 2){
s += 'X';
}
else s += 'Y';
}
if(s.length() == n - 1){
break;
}
}
int tmp = press(s + "AB");
if(tmp >= 1){
tmp = press(s + 'A');
if(tmp == 1){
s += 'A';
}
else s += 'B';
}
else{
tmp = press(s + 'X');
if(tmp == 1){
s += 'X';
}
else s += 'Y';
}
return s;
}
// signed main(){
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
// }