# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
986398 | Pyqe | Combo (IOI18_combo) | C++17 | 19 ms | 2004 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;
long long pst[3];
string kyy="ABXY",ky="";
string guess_sequence(int n)
{
long long i,k,z1;
string s,cr;
k=!!press("XY");
s=kyy[k*2+1];
z1=k*2+press(s);
cr=kyy[z1];
for(i=0;i<4;i++)
{
if(i==z1)
{
continue;
}
pst[ky.length()]=i;
ky=ky+kyy[i];
}
for(i=2;i<n;i++)
{
s=cr+ky[1]+cr+ky[2]+ky[0]+cr+ky[2]+ky[1]+cr+ky[2]+ky[2];
cr=cr+kyy[pst[press(s)-i+1]];
}
for(i=0;n>1&&i<2;i++)
{
s=cr+ky[i];
if(press(s)==n)
{
cr=cr+kyy[pst[i]];
break;
}
}
if(cr.length()<n)
{
cr=cr+kyy[pst[2]];
}
return cr;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |