Submission #96561

# Submission time Handle Problem Language Result Execution time Memory
96561 2019-02-10T10:07:46 Z Kastanda Genetics (BOI18_genetics) C++11
46 / 100
664 ms 32504 KB
// FAILED
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const int N = 4105;
int n, m, k;
ll R[N], H[4][N];
char A[N][N];
mt19937 Rnd(chrono::steady_clock::now().time_since_epoch().count());
int main()
{
    scanf("%d%d%d", &n, &m, &k);
    getchar();
    for (int i = 1; i <= n; i++, getchar())
        for (int j = 1; j <= m; j++)
        {
            int ch = getchar();
            if (ch == 'A') ch = 0;
            else if (ch == 'C') ch = 1;
            else if (ch == 'G') ch = 2;
            else ch = 3;
            A[i][j] = ch;
        }
    ll tot = 0;
    for (int i = 1; i <= n; i++)
        R[i] = Rnd(), tot += R[i];
    for (int j = 1; j <= m; j++)
        for (int i = 1; i <= n; i++)
            H[A[i][j]][j] += R[i];
    for (int i = 1; i <= n; i++)
    {
        ll sum = 0;
        for (int j = 1; j <= m; j++)
            for (int h = 0; h <= 3; h ++)
                if (A[i][j] != h)
                    sum += H[h][j];
        if (sum == (tot - R[i]) * k)
            return !printf("%d\n", i);
    }
    assert(0);
}

Compilation message

genetics.cpp: In function 'int main()':
genetics.cpp:29:22: warning: array subscript has type 'char' [-Wchar-subscripts]
             H[A[i][j]][j] += R[i];
                      ^
genetics.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d", &n, &m, &k);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 6 ms 636 KB Output is correct
5 Correct 6 ms 760 KB Output is correct
6 Correct 5 ms 760 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 632 KB Output is correct
10 Correct 6 ms 760 KB Output is correct
11 Correct 6 ms 632 KB Output is correct
12 Correct 5 ms 760 KB Output is correct
13 Correct 5 ms 760 KB Output is correct
14 Correct 6 ms 760 KB Output is correct
15 Correct 6 ms 760 KB Output is correct
16 Correct 5 ms 760 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 103 ms 6496 KB Output is correct
2 Correct 126 ms 7696 KB Output is correct
3 Correct 125 ms 7288 KB Output is correct
4 Correct 27 ms 4984 KB Output is correct
5 Correct 104 ms 7544 KB Output is correct
6 Correct 111 ms 7544 KB Output is correct
7 Correct 49 ms 3448 KB Output is correct
8 Correct 47 ms 3576 KB Output is correct
9 Correct 93 ms 7288 KB Output is correct
10 Correct 115 ms 7364 KB Output is correct
11 Correct 92 ms 6496 KB Output is correct
12 Correct 82 ms 6520 KB Output is correct
13 Correct 85 ms 6496 KB Output is correct
14 Correct 83 ms 5624 KB Output is correct
15 Correct 63 ms 5752 KB Output is correct
16 Correct 80 ms 6320 KB Output is correct
17 Correct 117 ms 7288 KB Output is correct
18 Correct 96 ms 7288 KB Output is correct
19 Correct 113 ms 7288 KB Output is correct
20 Correct 102 ms 7416 KB Output is correct
21 Correct 116 ms 7376 KB Output is correct
22 Correct 122 ms 7264 KB Output is correct
23 Correct 126 ms 7288 KB Output is correct
24 Correct 125 ms 7304 KB Output is correct
25 Correct 102 ms 7160 KB Output is correct
26 Correct 110 ms 7264 KB Output is correct
27 Correct 105 ms 7160 KB Output is correct
28 Correct 108 ms 7288 KB Output is correct
29 Correct 116 ms 7368 KB Output is correct
30 Correct 109 ms 7648 KB Output is correct
31 Correct 117 ms 7544 KB Output is correct
32 Correct 109 ms 7672 KB Output is correct
33 Correct 5 ms 376 KB Output is correct
34 Correct 5 ms 760 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 103 ms 6496 KB Output is correct
2 Correct 126 ms 7696 KB Output is correct
3 Correct 125 ms 7288 KB Output is correct
4 Correct 27 ms 4984 KB Output is correct
5 Correct 104 ms 7544 KB Output is correct
6 Correct 111 ms 7544 KB Output is correct
7 Correct 49 ms 3448 KB Output is correct
8 Correct 47 ms 3576 KB Output is correct
9 Correct 93 ms 7288 KB Output is correct
10 Correct 115 ms 7364 KB Output is correct
11 Correct 92 ms 6496 KB Output is correct
12 Correct 82 ms 6520 KB Output is correct
13 Correct 85 ms 6496 KB Output is correct
14 Correct 83 ms 5624 KB Output is correct
15 Correct 63 ms 5752 KB Output is correct
16 Correct 80 ms 6320 KB Output is correct
17 Correct 117 ms 7288 KB Output is correct
18 Correct 96 ms 7288 KB Output is correct
19 Correct 113 ms 7288 KB Output is correct
20 Correct 102 ms 7416 KB Output is correct
21 Correct 116 ms 7376 KB Output is correct
22 Correct 122 ms 7264 KB Output is correct
23 Correct 126 ms 7288 KB Output is correct
24 Correct 125 ms 7304 KB Output is correct
25 Correct 102 ms 7160 KB Output is correct
26 Correct 110 ms 7264 KB Output is correct
27 Correct 105 ms 7160 KB Output is correct
28 Correct 108 ms 7288 KB Output is correct
29 Correct 116 ms 7368 KB Output is correct
30 Correct 109 ms 7648 KB Output is correct
31 Correct 117 ms 7544 KB Output is correct
32 Correct 109 ms 7672 KB Output is correct
33 Correct 5 ms 376 KB Output is correct
34 Correct 5 ms 760 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
36 Correct 524 ms 14880 KB Output is correct
37 Correct 572 ms 16880 KB Output is correct
38 Correct 652 ms 16632 KB Output is correct
39 Correct 209 ms 14200 KB Output is correct
40 Correct 613 ms 16996 KB Output is correct
41 Correct 307 ms 8696 KB Output is correct
42 Correct 289 ms 8832 KB Output is correct
43 Correct 403 ms 14328 KB Output is correct
44 Correct 543 ms 17132 KB Output is correct
45 Correct 612 ms 16888 KB Output is correct
46 Correct 535 ms 16888 KB Output is correct
47 Correct 528 ms 14840 KB Output is correct
48 Correct 561 ms 14968 KB Output is correct
49 Correct 404 ms 12792 KB Output is correct
50 Correct 475 ms 12916 KB Output is correct
51 Correct 518 ms 14316 KB Output is correct
52 Correct 620 ms 16660 KB Output is correct
53 Correct 633 ms 16632 KB Output is correct
54 Correct 515 ms 18792 KB Output is correct
55 Correct 606 ms 18940 KB Output is correct
56 Correct 522 ms 18552 KB Output is correct
57 Correct 664 ms 18376 KB Output is correct
58 Correct 578 ms 18112 KB Output is correct
59 Correct 548 ms 18168 KB Output is correct
60 Correct 547 ms 18168 KB Output is correct
61 Correct 552 ms 17656 KB Output is correct
62 Correct 541 ms 26488 KB Output is correct
63 Correct 530 ms 32504 KB Output is correct
64 Execution timed out 288 ms 31504 KB Time limit exceeded (wall clock)
65 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 6 ms 636 KB Output is correct
5 Correct 6 ms 760 KB Output is correct
6 Correct 5 ms 760 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 632 KB Output is correct
10 Correct 6 ms 760 KB Output is correct
11 Correct 6 ms 632 KB Output is correct
12 Correct 5 ms 760 KB Output is correct
13 Correct 5 ms 760 KB Output is correct
14 Correct 6 ms 760 KB Output is correct
15 Correct 6 ms 760 KB Output is correct
16 Correct 5 ms 760 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 103 ms 6496 KB Output is correct
19 Correct 126 ms 7696 KB Output is correct
20 Correct 125 ms 7288 KB Output is correct
21 Correct 27 ms 4984 KB Output is correct
22 Correct 104 ms 7544 KB Output is correct
23 Correct 111 ms 7544 KB Output is correct
24 Correct 49 ms 3448 KB Output is correct
25 Correct 47 ms 3576 KB Output is correct
26 Correct 93 ms 7288 KB Output is correct
27 Correct 115 ms 7364 KB Output is correct
28 Correct 92 ms 6496 KB Output is correct
29 Correct 82 ms 6520 KB Output is correct
30 Correct 85 ms 6496 KB Output is correct
31 Correct 83 ms 5624 KB Output is correct
32 Correct 63 ms 5752 KB Output is correct
33 Correct 80 ms 6320 KB Output is correct
34 Correct 117 ms 7288 KB Output is correct
35 Correct 96 ms 7288 KB Output is correct
36 Correct 113 ms 7288 KB Output is correct
37 Correct 102 ms 7416 KB Output is correct
38 Correct 116 ms 7376 KB Output is correct
39 Correct 122 ms 7264 KB Output is correct
40 Correct 126 ms 7288 KB Output is correct
41 Correct 125 ms 7304 KB Output is correct
42 Correct 102 ms 7160 KB Output is correct
43 Correct 110 ms 7264 KB Output is correct
44 Correct 105 ms 7160 KB Output is correct
45 Correct 108 ms 7288 KB Output is correct
46 Correct 116 ms 7368 KB Output is correct
47 Correct 109 ms 7648 KB Output is correct
48 Correct 117 ms 7544 KB Output is correct
49 Correct 109 ms 7672 KB Output is correct
50 Correct 5 ms 376 KB Output is correct
51 Correct 5 ms 760 KB Output is correct
52 Correct 5 ms 376 KB Output is correct
53 Correct 524 ms 14880 KB Output is correct
54 Correct 572 ms 16880 KB Output is correct
55 Correct 652 ms 16632 KB Output is correct
56 Correct 209 ms 14200 KB Output is correct
57 Correct 613 ms 16996 KB Output is correct
58 Correct 307 ms 8696 KB Output is correct
59 Correct 289 ms 8832 KB Output is correct
60 Correct 403 ms 14328 KB Output is correct
61 Correct 543 ms 17132 KB Output is correct
62 Correct 612 ms 16888 KB Output is correct
63 Correct 535 ms 16888 KB Output is correct
64 Correct 528 ms 14840 KB Output is correct
65 Correct 561 ms 14968 KB Output is correct
66 Correct 404 ms 12792 KB Output is correct
67 Correct 475 ms 12916 KB Output is correct
68 Correct 518 ms 14316 KB Output is correct
69 Correct 620 ms 16660 KB Output is correct
70 Correct 633 ms 16632 KB Output is correct
71 Correct 515 ms 18792 KB Output is correct
72 Correct 606 ms 18940 KB Output is correct
73 Correct 522 ms 18552 KB Output is correct
74 Correct 664 ms 18376 KB Output is correct
75 Correct 578 ms 18112 KB Output is correct
76 Correct 548 ms 18168 KB Output is correct
77 Correct 547 ms 18168 KB Output is correct
78 Correct 552 ms 17656 KB Output is correct
79 Correct 541 ms 26488 KB Output is correct
80 Correct 530 ms 32504 KB Output is correct
81 Execution timed out 288 ms 31504 KB Time limit exceeded (wall clock)
82 Halted 0 ms 0 KB -