# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
955854 | ASGA_RedSea | 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;
//int press(string s){cout<<"press : "<<s<<" : ";int r;cin>>r;return r;}
string guess_sequence(int n){
string s,c = "ABXY";
int f = 0;
for(int i = 0;i < 3;i++){
f = press(string(1,c[i]));
if(f){s += c[i];c.erase(i,1);break;}
}
if(!f){s += c.back();c.pop_back();}
for(int i = 1;i < n;i++){
f = 0;
for(int j = 0;j < 2;j++){
if(press(s + string(1,c[j])) > s.size()){f = 1;s += c[j];break;}
}
if(!f){s += c.back();}
}
return s;
}
//int main(){int n;cin>>n;cout<<guess_sequence(n);return 0;}