# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20589 | 2017-02-12T14:06:44 Z | model_code | Martian DNA (IOI16_dna) | C | 9 ms | 1144 KB |
#include "dna_c.h" #include "strings.h" void zeroes(int m, char* s) { for (int i = 0; i < m; ++i) s[i] = '0'; s[m] = 0; } char s[2001]; char test[2001]; char temp[2001]; char* analyse(int n, int t) { int l = 0, r = n + 1; while (l < r - 1) { int m = (l + r) >> 1; zeroes(m, test); if (make_test(test)) l = m; else r = m; } zeroes(l, s); int zeroesCount = 0; int maxZeroesCount = l; int slen = l; while (1) { strcat(s, "1"); slen++; if (!make_test(s)) { s[slen - 1] = '0'; ++zeroesCount; } else { zeroesCount = 0; } if (zeroesCount + maxZeroesCount >= n || zeroesCount >= maxZeroesCount + 1) break; } l = 0, r = zeroesCount; s[slen - zeroesCount] = 0; slen -= zeroesCount; while (l < r - 1) { int m = (l + r) >> 1; strcpy(test, s); zeroes(m, temp); strcat(test, temp); if (make_test(test)) l = m; else r = m; } zeroes(l, temp); strcat(s, temp); slen += l; while (slen < n) { strcpy(temp, "1"); strcat(temp, s); strcpy(s, temp); slen++; if (!make_test(s)) { s[0] = '0'; } } return s; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1144 KB | Output is correct |
2 | Correct | 0 ms | 1144 KB | Output is correct |
3 | Correct | 0 ms | 1144 KB | Output is correct |
4 | Correct | 0 ms | 1144 KB | Output is correct |
5 | Correct | 0 ms | 1144 KB | Output is correct |
6 | Correct | 0 ms | 1144 KB | Output is correct |
7 | Correct | 0 ms | 1144 KB | Output is correct |
8 | Correct | 0 ms | 1144 KB | Output is correct |
9 | Correct | 0 ms | 1144 KB | Output is correct |
10 | Correct | 0 ms | 1144 KB | Output is correct |
11 | Correct | 0 ms | 1144 KB | Output is correct |
12 | Correct | 0 ms | 1144 KB | Output is correct |
13 | Correct | 0 ms | 1144 KB | Output is correct |
14 | Correct | 0 ms | 1144 KB | Output is correct |
15 | Correct | 0 ms | 1144 KB | Output is correct |
16 | Correct | 0 ms | 1144 KB | Output is correct |
17 | Correct | 0 ms | 1144 KB | Output is correct |
18 | Correct | 0 ms | 1144 KB | Output is correct |
19 | Correct | 0 ms | 1144 KB | Output is correct |
20 | Correct | 0 ms | 1144 KB | Output is correct |
21 | Correct | 0 ms | 1144 KB | Output is correct |
22 | Correct | 0 ms | 1144 KB | Output is correct |
23 | Correct | 0 ms | 1144 KB | Output is correct |
24 | Correct | 0 ms | 1144 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1144 KB | Output is correct |
2 | Correct | 0 ms | 1144 KB | Output is correct |
3 | Correct | 0 ms | 1144 KB | Output is correct |
4 | Correct | 0 ms | 1144 KB | Output is correct |
5 | Correct | 0 ms | 1144 KB | Output is correct |
6 | Correct | 0 ms | 1144 KB | Output is correct |
7 | Correct | 0 ms | 1144 KB | Output is correct |
8 | Correct | 0 ms | 1144 KB | Output is correct |
9 | Correct | 0 ms | 1144 KB | Output is correct |
10 | Correct | 0 ms | 1144 KB | Output is correct |
11 | Correct | 0 ms | 1144 KB | Output is correct |
12 | Correct | 0 ms | 1144 KB | Output is correct |
13 | Correct | 0 ms | 1144 KB | Output is correct |
14 | Correct | 0 ms | 1144 KB | Output is correct |
15 | Correct | 0 ms | 1144 KB | Output is correct |
16 | Correct | 0 ms | 1144 KB | Output is correct |
17 | Correct | 0 ms | 1144 KB | Output is correct |
18 | Correct | 0 ms | 1144 KB | Output is correct |
19 | Correct | 0 ms | 1144 KB | Output is correct |
20 | Correct | 0 ms | 1144 KB | Output is correct |
21 | Correct | 0 ms | 1144 KB | Output is correct |
22 | Correct | 0 ms | 1144 KB | Output is correct |
23 | Correct | 0 ms | 1144 KB | Output is correct |
24 | Correct | 0 ms | 1144 KB | Output is correct |
25 | Correct | 0 ms | 1144 KB | Output is correct |
26 | Correct | 0 ms | 1144 KB | Output is correct |
27 | Correct | 0 ms | 1144 KB | Output is correct |
28 | Correct | 0 ms | 1144 KB | Output is correct |
29 | Correct | 0 ms | 1144 KB | Output is correct |
30 | Correct | 0 ms | 1144 KB | Output is correct |
31 | Correct | 0 ms | 1144 KB | Output is correct |
32 | Correct | 0 ms | 1144 KB | Output is correct |
33 | Correct | 0 ms | 1144 KB | Output is correct |
34 | Correct | 0 ms | 1144 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1144 KB | Output is correct |
2 | Correct | 0 ms | 1144 KB | Output is correct |
3 | Correct | 0 ms | 1144 KB | Output is correct |
4 | Correct | 0 ms | 1144 KB | Output is correct |
5 | Correct | 0 ms | 1144 KB | Output is correct |
6 | Correct | 0 ms | 1144 KB | Output is correct |
7 | Correct | 0 ms | 1144 KB | Output is correct |
8 | Correct | 0 ms | 1144 KB | Output is correct |
9 | Correct | 0 ms | 1144 KB | Output is correct |
10 | Correct | 0 ms | 1144 KB | Output is correct |
11 | Correct | 0 ms | 1144 KB | Output is correct |
12 | Correct | 0 ms | 1144 KB | Output is correct |
13 | Correct | 0 ms | 1144 KB | Output is correct |
14 | Correct | 0 ms | 1144 KB | Output is correct |
15 | Correct | 0 ms | 1144 KB | Output is correct |
16 | Correct | 0 ms | 1144 KB | Output is correct |
17 | Correct | 0 ms | 1144 KB | Output is correct |
18 | Correct | 0 ms | 1144 KB | Output is correct |
19 | Correct | 0 ms | 1144 KB | Output is correct |
20 | Correct | 0 ms | 1144 KB | Output is correct |
21 | Correct | 0 ms | 1144 KB | Output is correct |
22 | Correct | 6 ms | 1144 KB | Output is correct |
23 | Correct | 6 ms | 1144 KB | Output is correct |
24 | Correct | 6 ms | 1144 KB | Output is correct |
25 | Correct | 9 ms | 1144 KB | Output is correct |
26 | Correct | 9 ms | 1144 KB | Output is correct |
27 | Correct | 3 ms | 1144 KB | Output is correct |
28 | Correct | 3 ms | 1144 KB | Output is correct |
29 | Correct | 0 ms | 1144 KB | Output is correct |
30 | Correct | 3 ms | 1144 KB | Output is correct |
31 | Correct | 3 ms | 1144 KB | Output is correct |
32 | Correct | 0 ms | 1144 KB | Output is correct |
33 | Correct | 3 ms | 1144 KB | Output is correct |
34 | Correct | 3 ms | 1144 KB | Output is correct |
35 | Correct | 3 ms | 1144 KB | Output is correct |
36 | Correct | 3 ms | 1144 KB | Output is correct |
37 | Correct | 3 ms | 1144 KB | Output is correct |
38 | Correct | 3 ms | 1144 KB | Output is correct |
39 | Correct | 6 ms | 1144 KB | Output is correct |