# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
615502 | Shithila | Combo (IOI18_combo) | C++14 | 1 ms | 208 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;
std::string guess_sequence(int N) {
std::string p = "";
int len=0;
string letter=("A","B","X","Y");
int first=3;
for(int i=0;i<3;i++)
{
string pas=p+letter[i];
if(press(pas)==1)
{
first=i;
p=pas;
break;
}
}
if(first==3) p=p+letter[3];
for(int j=1;j<N;j++)
{
if(first==3)
{
int second=2;
for(int i=0;i<2;i++)
{
string pas=p+letter[i];
if(press(pas)==1)
{
second=i;
p=pas;
break;
}
}
if(second==2) p=p+letter[2];
}
else
{
int second=first+1;
for(int i=0;i<second;i++)
{
string pas=p+letter[i];
if(press(pas)==1)
{
second=i;
p=pas;
break;
}
}
for(int i=second+1;i<3;i++)
{
string pas=p+letter[i];
if(press(pas)==1)
{
second=i;
p=pas;
break;
}
}
if(second==first+1) p=p+letter[first+1];
}
}
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |