# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
737777 | Elvin_Fritl | 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>
using namespace std;
#include "combo.h"
string guess_sequence(int N) {
string s;
vector<char>v;
if(press("A")==1){
s+='A';
v.push_back('B');
v.push_back('Y');
v.push_back('X');
}
else if(press("B")==1){
s+='B';
v.push_back('A');
v.push_back('Y');
v.push_back('X');
}
else if(press("X")==1){
s+='X';
v.push_back('B');
v.push_back('Y');
v.push_back('A');
}
else{
s+='Y';
v.push_back('B');
v.push_back('A');
v.push_back('X');
}
for(int i=1;i<n;i++){
for(char i:v){
if(press(s+i)==i+1){
s+=i;
break;
}
}
}
return S;
}