# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
926399 | rainboy | Martian DNA (IOI16_dna) | C11 | 10 ms | 604 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_c.h"
#include <stdlib.h>
#define N 1000
#define K 20
char cc[N + K + 1];
char *analyse(int n, int t) {
int m, k, i;
char c;
srand(12345);
m = 0, k = 0;
while (k < K) {
cc[m++] = rand() % 2 + '0';
cc[m] = 0;
if (make_test(cc))
k = 0;
else
cc[m - 1] = cc[m - 1] == '0' ? '1' : '0', k++;
}
for (i = m - k + 1; i <= m; i++) {
c = cc[i];
cc[i] = 0;
if (!make_test(cc)) {
m = i - 1;
break;
}
cc[i] = c;
}
while (m < n) {
m++;
for (i = m - 1; i > 0; i--)
cc[i] = cc[i - 1];
cc[0] = '0';
cc[m] = 0;
if (!make_test(cc))
cc[0] = '1';
}
cc[n] = 0;
return cc;
}
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... |