# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
402447 | Alma | Martian DNA (IOI16_dna) | C++17 | 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 <bits/stdc++.h>
#include "dna.h"
using namespace std;
bool make_test (string s) {}
string analyse(int n, int t) {
string p = "";
while ((int)p.size() < n) {
if (make_test(p + '0')) p += '0';
else p += '1';
if (make_test('0' + p)) p = '0' + p;
else p = '1' + p;
if ((int)p.size() > n || !make_test(p)) {
int m = (int)p.size();
if (make_test(p.substr(1, m-1))) {
p = p.substr(1, m-1);
while (true) {
if ((int)p.size() == n) return p;
if (make_test(p + '0')) p += '0';
else p += '1';
}
} else {
p = p.substr(0, m-1);
while (true) {
if ((int)p.size() == n) return p;
if (make_test('0' + p)) p = '0' + p;
else p = '1' + p;
}
}
}
} return p;
}