# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
670666 | Essa2006 | Combo (IOI18_combo) | C++14 | 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;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), a.end()
#define mod (ll)(1000000007)
string ans="";
string guess_sequence(int n){
string a="ABXY";
char c;
for(int i=0;i<4;i++){
if(press(a[i]))
ans.push_back(a[i]), c=a[i];
}
string b=a;
a="";
for(int i=0;i<4;i++){
if(b[i]!=c)
a.push_back(b[i]);
}
for(int i=1;i<n;i++){
for(int j=0;j<3;j++){
if(press(ans+b[j])==i+1){
ans.push_back(b[j]);
break;
}
}
}
return ans;
}