# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
400158 | EJOI2019Andrew | Martian DNA (IOI16_dna) | C++14 | 0 ms | 0 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 "dna.h"
#include <cstdlib>
vector< string > vc;
void r(int n, string s="")
{
if(s.lenght()==n)
vc.push_back(s);
else
{
r(n, s+'0');
r(n, s+'1');
}
}
std::string analyse(int n, int t) {
if(n<=4)
{
r(n);
for(auto c:vc)
{
if(make_test(c))
return c;
}
}
else
{
r(4);
for(auto c:vc)
{
if(make_test('0'+c))
return '0'+c;
if(make_test('1'+c))
return '1'+c;
if(make_test(c+'1'))
return c+'1';
if(make_test(c+'0'))
return c+'0';
}
}
}