# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427773 | jk410 | Combo (IOI18_combo) | C++17 | 52 ms | 684 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"
using namespace std;
string guess_sequence(int N) {
string cmp,S;
S=(press("AB")?(press("A")?"A":"B"):(press("X")?"X":"Y"));
if (N==1)
return S;
if (S=="A")
cmp="BXY";
else if (S=="B")
cmp="AXY";
else if (S=="X")
cmp="ABY";
else
cmp="ABX";
for (int i=2; i<N; i++){
int p=press(S+cmp[0]+cmp[0]+S+cmp[0]+cmp[1]+S+cmp[0]+cmp[2]+S+cmp[1]);
if (p==i+1)
S=S+cmp[0];
else if (p==i)
S=S+cmp[1];
else
S=S+cmp[2];
}
if (press(S+cmp[0])==N)
S=S+cmp[0];
else if (press(S+cmp[1])==N)
S=S+cmp[1];
else
S=S+cmp[2];
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |