# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908738 | Aiperiii | Combo (IOI18_combo) | C++14 | 1 ms | 344 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>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string s="";
string x="";
x=s;
x+='A';x+=s;x+='B';
int res1=press(x);
if(res1==1){
x=s;x+='A';
if(press(x)==1)s+='A';
else s+='B';
}
else{
x=s;x+='X';
if(press(x)==1)s+='X';
else s+='Y';
}
string t="ABXY";
string d="";
for(int i=0;i<t.size();i++){
if(t[i]!=s[0])d+=t[i];
}
for(int j=1;j<N;j++){
x=s;
x+=d[0];x+=s;x+=d[1];
int res1=press(x);
if(res1==j+1){
x=s;x+=d[0];
if(press(x)==j+1)s+=d[0];
else s+=d[1];
}
else{
s+=d[2];
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |