# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499965 | Khizri | 콤보 (IOI18_combo) | C++17 | 68 ms | 596 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
string x="ABXY";
bool ask(int l,int r,string ans){
string p="";
for(int i=l;i<=r;i++){
p+=ans;
p+=x[i];
}
//cout<<p<<endl;
if(press(p)>=ans.size()+1){
return true;
}
return false;
}
string guess_sequence(int n) {
string ans="";
for(int i=0;i<n;i++){
int l=0,r=3;
while(l<=r){
int m=(l+r)/2;
if(ask(l,m,ans)){
r=m-1;
}
else{
l=m+1;
}
}
ans+=x[r+1];
}
//cout<<ans<<endl;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |