# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96583 | jhnah917 | Combo (IOI18_combo) | C++14 | 45 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 <vector>
using namespace std;
string guess_sequence(int n){
string S;
if(press("AB")){
if(press("A")) S = "A";
else S = "B";
}else{
if(press("X")) S = "X";
else S = "Y";
}
vector<string> v;
if(S != "A") v.push_back("A");
if(S != "B") v.push_back("B");
if(S != "X") v.push_back("X");
if(S != "Y") v.push_back("Y");
string p = v[0], q = v[1], r = v[2];
for(int i=2; i<n; i++){
int sz = S.size();
int now = press(S+p+p + S+p+q + S+p+r + S+q);
if(now == sz+2) S += p;
else if(now == sz+1) S += q;
else S += r;
}
if(n != 1){
if(press(S+p) > S.size()) S += p;
else if(press(S+q) > S.size()) S += q;
else S += r;
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |