# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
380106 | Dan4Life | Combo (IOI18_combo) | C++17 | 2 ms | 256 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 p = "", x = "ABXY";
for(int i = 0; i < 3; i++)
{
p = x[i];
int first = press(p);
if(first==1){
x.erase(x.begin()+i);
break;
}
}
if(x.size()==4)p+="Y", x.erase(prev(x.end()));
string S = p;
for(int i = 1; i < N; i++)
{
bool got_next = false;
for(int j = 0; j < 2; j++){
int next = press(p+x[j]);
if(next==p.size()+1){
p+=x[j]; got_next =true; break;
}
}
if(!got_next)p+=x[2];
}
S=p;
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |