# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101644 | lolicon | Combo (IOI18_combo) | C++14 | 3 ms | 220 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<algorithm>
std::string guess_sequence(int N){
std::string s, p, c = {"ABXY"};
int i,j,t,coin = 0;
if(press("AB")){
if(press("A"))
s+= 'A', std::swap(c[0],c[3]);
else
s+= 'B', std::swap(c[1],c[3]);
} else {
if(press("X"))
s+= 'X', std::swap(c[2],c[3]);
else
s+= 'Y';
} coin++;
for(i=1;i<N-1;i++){
t = press(s+c[0]+s+c[1]+c[2]+s+c[1]+c[1]+s+c[1]+c[0]) - coin;
if(t == 1){
s+=c[0];
} else if(t == 2){
s+=c[1];
} else {
s+=c[2];
}
coin++;
}
if(press(s+c[0])==coin+1) s+=c[0];
else if(press(s+c[1])==coin+1) s+=c[1];
else s+=c[2];
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |