# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433411 | Kanaifu | Martian DNA (IOI16_dna) | C++14 | 13 ms | 376 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 "dna.h"
#include <cstdlib>
//#include "grader.cpp"
using namespace std;
mt19937 randseed(time(nullptr));
std::string analyse(int n, int t)
{
bool suff = false;
int last = 0;
string sub = "";
string las = "";
while ((int)las.size()<n)
{
if (suff)
{
sub = "0" + sub;
if (!make_test(sub))
{
sub[0] = '1';
}
las = sub;
continue;
}
int koristi = randseed() % 2;
if (koristi)
{
sub += "1";
if (make_test(sub))
{
las = sub;
last = 0;
}
else
{
sub.back()= '0';
last++;
if (last>20)
{
suff=true;
sub = las;
continue;
}
}
}
else
{
sub += "0";
if (make_test(sub))
{
las = sub;
last = 0;
}
else
{
sub.back() = '1';
last++;
if (last>20)
{
suff=true;
sub = las;
continue;
}
}
}
//cout<<las<<" ";
}
return las;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |