# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
501526 | dnaux | 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 "combo.h"
using namespace std;
string guess_sequence(int N){
string s = "";
char c1 = 'X',c2 = 'Y',c3 = 'A';
if(press("XY") != 0){
if(press("X") != 0){s += 'X';c1 = 'B';}
else {s += 'Y';c2 = 'B';}
}
else{
if(press('A') != 0)(s += 'A';c3 = 'B';)
else s += 'B';
}
for(int i = 0;i < n - 1; i++){
if(press(s + c1 + s + c2) > i + 1){
if(press(s + c1) > i + 1){
s += c1;
}
else{
s += c2;
}
}
else s += c3;
}
return s;
}