# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108127 | autumn_eel | Combo (IOI18_combo) | C++14 | 51 ms | 584 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>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
#include "combo.h"
string s="ABXY";
string guess_sequence(int N) {
function<char(string)>dfs=[&](string s){
if(s.size()==1)return s[0];
int res=press(s.substr(0,s.size()/2));
if(res)return dfs(s.substr(0,s.size()/2));
return dfs(s.substr(s.size()/2));
};
char c=dfs(s);
string ans;ans+=c;
if(N==1)return ans;
string t;
rep(i,4){
if(s[i]!=c)t+=s[i];
}
for(int i=1;i<N-1;i++){
string ask=ans+t[0];
rep(j,3)ask+=ans+t[1]+t[j];
int res=press(ask);
if(res==i){
ans+=t[2];
}
else if(res==i+1){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |