# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433421 | Kanaifu | Martian DNA (IOI16_dna) | C++14 | 12 ms | 392 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 = "";
int calls = 0;
while ((int)las.size()<n)
{
//cout<<las<<" "<<sub<<"\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>6)
{
int ind = las.size();
if (make_test(las+sub[ind]))
{
las+=sub[ind];
last--;
continue;
}
suff=true;
sub = las;
continue;
}
}
}
else
{
sub += "0";
if (make_test(sub))
{
las = sub;
last = 0;
}
else
{
sub.back() = '1';
last++;
if (last>6)
{
int ind = las.size();
if (make_test(las+sub[ind]))
{
las+=sub[ind];
last--;
continue;
}
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... |