# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305459 | juggernaut | Combo (IOI18_combo) | C++14 | 38 ms | 556 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;
#ifdef _static-libgcc
#include"combo.cpp"
#endif
string guess_sequence(int n){
string res;
int i=2,q;
char a='A',b='B',c='Y';
if(press("XY"))
if(press("X"))res="X";
else res="Y",c='X';
else
if(press("A"))res="A",a='X';
else res="B",b='X';
for(;i<n;i++){
q=press(res+a+res+b+a+res+b+b+res+b+c);
if(q==i)res+=a;
else if(q==i+1)res+=b;
else res+=c;
}
if(i==n)
if(press(res+a)==n)res+=a;
else if(press(res+b)==n)res+=b;
else res+=c;
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |