Submission #121014

# Submission time Handle Problem Language Result Execution time Memory
121014 2019-06-26T02:27:26 Z IOrtroiii Genetics (BOI18_genetics) C++14
100 / 100
394 ms 21368 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 4107;

int n, m, k;
string s[N];
long long x[N];
long long f[N][4];
long long g[N];
long long X = 0;

int type(char c) {
    if (c == 'A') return 0;
    if (c == 'C') return 1;
    if (c == 'G') return 2;
    return 3;
}

int main() {
    srand(time(NULL));
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> k;
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
        x[i] = rand();
        X += x[i];
        for (int j = 0; j < m; ++j) f[j][type(s[i][j])] += x[i];
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            int t = type(s[i][j]);
            for (int tt = 0; tt < 4; ++tt) {
                if (tt != t) g[i] += f[j][tt];
            }
        }
        if (g[i] == k * (X - x[i])) return cout << i + 1 << '\n',0;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 504 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 504 KB Output is correct
5 Correct 5 ms 504 KB Output is correct
6 Correct 5 ms 504 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 504 KB Output is correct
9 Correct 5 ms 504 KB Output is correct
10 Correct 5 ms 504 KB Output is correct
11 Correct 5 ms 504 KB Output is correct
12 Correct 5 ms 508 KB Output is correct
13 Correct 5 ms 504 KB Output is correct
14 Correct 5 ms 504 KB Output is correct
15 Correct 5 ms 504 KB Output is correct
16 Correct 5 ms 504 KB Output is correct
17 Correct 5 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 54 ms 3704 KB Output is correct
2 Correct 45 ms 4472 KB Output is correct
3 Correct 64 ms 4344 KB Output is correct
4 Correct 17 ms 1528 KB Output is correct
5 Correct 38 ms 4472 KB Output is correct
6 Correct 45 ms 4476 KB Output is correct
7 Correct 29 ms 2296 KB Output is correct
8 Correct 26 ms 2296 KB Output is correct
9 Correct 34 ms 4088 KB Output is correct
10 Correct 54 ms 4216 KB Output is correct
11 Correct 45 ms 3704 KB Output is correct
12 Correct 31 ms 3704 KB Output is correct
13 Correct 36 ms 3704 KB Output is correct
14 Correct 46 ms 3324 KB Output is correct
15 Correct 30 ms 3320 KB Output is correct
16 Correct 33 ms 3448 KB Output is correct
17 Correct 55 ms 4344 KB Output is correct
18 Correct 36 ms 4216 KB Output is correct
19 Correct 52 ms 4344 KB Output is correct
20 Correct 38 ms 4216 KB Output is correct
21 Correct 52 ms 4344 KB Output is correct
22 Correct 60 ms 4216 KB Output is correct
23 Correct 62 ms 4292 KB Output is correct
24 Correct 61 ms 4260 KB Output is correct
25 Correct 41 ms 4216 KB Output is correct
26 Correct 48 ms 4472 KB Output is correct
27 Correct 45 ms 4344 KB Output is correct
28 Correct 45 ms 4344 KB Output is correct
29 Correct 54 ms 4344 KB Output is correct
30 Correct 30 ms 4600 KB Output is correct
31 Correct 42 ms 4600 KB Output is correct
32 Correct 43 ms 4472 KB Output is correct
33 Correct 5 ms 504 KB Output is correct
34 Correct 5 ms 504 KB Output is correct
35 Correct 5 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 54 ms 3704 KB Output is correct
2 Correct 45 ms 4472 KB Output is correct
3 Correct 64 ms 4344 KB Output is correct
4 Correct 17 ms 1528 KB Output is correct
5 Correct 38 ms 4472 KB Output is correct
6 Correct 45 ms 4476 KB Output is correct
7 Correct 29 ms 2296 KB Output is correct
8 Correct 26 ms 2296 KB Output is correct
9 Correct 34 ms 4088 KB Output is correct
10 Correct 54 ms 4216 KB Output is correct
11 Correct 45 ms 3704 KB Output is correct
12 Correct 31 ms 3704 KB Output is correct
13 Correct 36 ms 3704 KB Output is correct
14 Correct 46 ms 3324 KB Output is correct
15 Correct 30 ms 3320 KB Output is correct
16 Correct 33 ms 3448 KB Output is correct
17 Correct 55 ms 4344 KB Output is correct
18 Correct 36 ms 4216 KB Output is correct
19 Correct 52 ms 4344 KB Output is correct
20 Correct 38 ms 4216 KB Output is correct
21 Correct 52 ms 4344 KB Output is correct
22 Correct 60 ms 4216 KB Output is correct
23 Correct 62 ms 4292 KB Output is correct
24 Correct 61 ms 4260 KB Output is correct
25 Correct 41 ms 4216 KB Output is correct
26 Correct 48 ms 4472 KB Output is correct
27 Correct 45 ms 4344 KB Output is correct
28 Correct 45 ms 4344 KB Output is correct
29 Correct 54 ms 4344 KB Output is correct
30 Correct 30 ms 4600 KB Output is correct
31 Correct 42 ms 4600 KB Output is correct
32 Correct 43 ms 4472 KB Output is correct
33 Correct 5 ms 504 KB Output is correct
34 Correct 5 ms 504 KB Output is correct
35 Correct 5 ms 504 KB Output is correct
36 Correct 204 ms 18808 KB Output is correct
37 Correct 177 ms 20600 KB Output is correct
38 Correct 304 ms 20728 KB Output is correct
39 Correct 85 ms 7928 KB Output is correct
40 Correct 249 ms 20728 KB Output is correct
41 Correct 133 ms 11128 KB Output is correct
42 Correct 106 ms 11128 KB Output is correct
43 Correct 139 ms 15224 KB Output is correct
44 Correct 172 ms 21240 KB Output is correct
45 Correct 253 ms 20984 KB Output is correct
46 Correct 169 ms 20984 KB Output is correct
47 Correct 222 ms 18976 KB Output is correct
48 Correct 255 ms 19192 KB Output is correct
49 Correct 139 ms 16636 KB Output is correct
50 Correct 222 ms 16580 KB Output is correct
51 Correct 223 ms 18040 KB Output is correct
52 Correct 292 ms 21172 KB Output is correct
53 Correct 288 ms 21116 KB Output is correct
54 Correct 173 ms 19964 KB Output is correct
55 Correct 236 ms 20364 KB Output is correct
56 Correct 167 ms 20216 KB Output is correct
57 Correct 305 ms 21112 KB Output is correct
58 Correct 226 ms 21112 KB Output is correct
59 Correct 192 ms 20984 KB Output is correct
60 Correct 189 ms 21240 KB Output is correct
61 Correct 191 ms 20984 KB Output is correct
62 Correct 178 ms 21368 KB Output is correct
63 Correct 167 ms 20984 KB Output is correct
64 Correct 183 ms 21288 KB Output is correct
65 Correct 277 ms 21240 KB Output is correct
66 Correct 258 ms 20984 KB Output is correct
67 Correct 267 ms 21188 KB Output is correct
68 Correct 221 ms 21112 KB Output is correct
69 Correct 159 ms 20984 KB Output is correct
70 Correct 261 ms 21368 KB Output is correct
71 Correct 219 ms 21112 KB Output is correct
72 Correct 224 ms 21112 KB Output is correct
73 Correct 252 ms 20984 KB Output is correct
74 Correct 5 ms 504 KB Output is correct
75 Correct 5 ms 504 KB Output is correct
76 Correct 5 ms 408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 504 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 5 ms 504 KB Output is correct
5 Correct 5 ms 504 KB Output is correct
6 Correct 5 ms 504 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 504 KB Output is correct
9 Correct 5 ms 504 KB Output is correct
10 Correct 5 ms 504 KB Output is correct
11 Correct 5 ms 504 KB Output is correct
12 Correct 5 ms 508 KB Output is correct
13 Correct 5 ms 504 KB Output is correct
14 Correct 5 ms 504 KB Output is correct
15 Correct 5 ms 504 KB Output is correct
16 Correct 5 ms 504 KB Output is correct
17 Correct 5 ms 504 KB Output is correct
18 Correct 54 ms 3704 KB Output is correct
19 Correct 45 ms 4472 KB Output is correct
20 Correct 64 ms 4344 KB Output is correct
21 Correct 17 ms 1528 KB Output is correct
22 Correct 38 ms 4472 KB Output is correct
23 Correct 45 ms 4476 KB Output is correct
24 Correct 29 ms 2296 KB Output is correct
25 Correct 26 ms 2296 KB Output is correct
26 Correct 34 ms 4088 KB Output is correct
27 Correct 54 ms 4216 KB Output is correct
28 Correct 45 ms 3704 KB Output is correct
29 Correct 31 ms 3704 KB Output is correct
30 Correct 36 ms 3704 KB Output is correct
31 Correct 46 ms 3324 KB Output is correct
32 Correct 30 ms 3320 KB Output is correct
33 Correct 33 ms 3448 KB Output is correct
34 Correct 55 ms 4344 KB Output is correct
35 Correct 36 ms 4216 KB Output is correct
36 Correct 52 ms 4344 KB Output is correct
37 Correct 38 ms 4216 KB Output is correct
38 Correct 52 ms 4344 KB Output is correct
39 Correct 60 ms 4216 KB Output is correct
40 Correct 62 ms 4292 KB Output is correct
41 Correct 61 ms 4260 KB Output is correct
42 Correct 41 ms 4216 KB Output is correct
43 Correct 48 ms 4472 KB Output is correct
44 Correct 45 ms 4344 KB Output is correct
45 Correct 45 ms 4344 KB Output is correct
46 Correct 54 ms 4344 KB Output is correct
47 Correct 30 ms 4600 KB Output is correct
48 Correct 42 ms 4600 KB Output is correct
49 Correct 43 ms 4472 KB Output is correct
50 Correct 5 ms 504 KB Output is correct
51 Correct 5 ms 504 KB Output is correct
52 Correct 5 ms 504 KB Output is correct
53 Correct 204 ms 18808 KB Output is correct
54 Correct 177 ms 20600 KB Output is correct
55 Correct 304 ms 20728 KB Output is correct
56 Correct 85 ms 7928 KB Output is correct
57 Correct 249 ms 20728 KB Output is correct
58 Correct 133 ms 11128 KB Output is correct
59 Correct 106 ms 11128 KB Output is correct
60 Correct 139 ms 15224 KB Output is correct
61 Correct 172 ms 21240 KB Output is correct
62 Correct 253 ms 20984 KB Output is correct
63 Correct 169 ms 20984 KB Output is correct
64 Correct 222 ms 18976 KB Output is correct
65 Correct 255 ms 19192 KB Output is correct
66 Correct 139 ms 16636 KB Output is correct
67 Correct 222 ms 16580 KB Output is correct
68 Correct 223 ms 18040 KB Output is correct
69 Correct 292 ms 21172 KB Output is correct
70 Correct 288 ms 21116 KB Output is correct
71 Correct 173 ms 19964 KB Output is correct
72 Correct 236 ms 20364 KB Output is correct
73 Correct 167 ms 20216 KB Output is correct
74 Correct 305 ms 21112 KB Output is correct
75 Correct 226 ms 21112 KB Output is correct
76 Correct 192 ms 20984 KB Output is correct
77 Correct 189 ms 21240 KB Output is correct
78 Correct 191 ms 20984 KB Output is correct
79 Correct 178 ms 21368 KB Output is correct
80 Correct 167 ms 20984 KB Output is correct
81 Correct 183 ms 21288 KB Output is correct
82 Correct 277 ms 21240 KB Output is correct
83 Correct 258 ms 20984 KB Output is correct
84 Correct 267 ms 21188 KB Output is correct
85 Correct 221 ms 21112 KB Output is correct
86 Correct 159 ms 20984 KB Output is correct
87 Correct 261 ms 21368 KB Output is correct
88 Correct 219 ms 21112 KB Output is correct
89 Correct 224 ms 21112 KB Output is correct
90 Correct 252 ms 20984 KB Output is correct
91 Correct 5 ms 504 KB Output is correct
92 Correct 5 ms 504 KB Output is correct
93 Correct 5 ms 408 KB Output is correct
94 Correct 191 ms 19960 KB Output is correct
95 Correct 231 ms 20400 KB Output is correct
96 Correct 393 ms 20344 KB Output is correct
97 Correct 217 ms 11384 KB Output is correct
98 Correct 115 ms 7544 KB Output is correct
99 Correct 261 ms 20088 KB Output is correct
100 Correct 167 ms 10744 KB Output is correct
101 Correct 134 ms 10744 KB Output is correct
102 Correct 165 ms 14456 KB Output is correct
103 Correct 207 ms 20728 KB Output is correct
104 Correct 344 ms 20784 KB Output is correct
105 Correct 394 ms 20604 KB Output is correct
106 Correct 343 ms 20216 KB Output is correct
107 Correct 168 ms 18808 KB Output is correct
108 Correct 195 ms 16120 KB Output is correct
109 Correct 266 ms 18556 KB Output is correct
110 Correct 307 ms 17016 KB Output is correct
111 Correct 236 ms 21020 KB Output is correct
112 Correct 312 ms 20728 KB Output is correct
113 Correct 258 ms 19448 KB Output is correct
114 Correct 130 ms 19452 KB Output is correct
115 Correct 327 ms 19448 KB Output is correct
116 Correct 350 ms 20984 KB Output is correct
117 Correct 329 ms 20856 KB Output is correct
118 Correct 316 ms 20860 KB Output is correct
119 Correct 275 ms 20728 KB Output is correct
120 Correct 337 ms 20856 KB Output is correct
121 Correct 200 ms 18808 KB Output is correct
122 Correct 171 ms 20600 KB Output is correct
123 Correct 291 ms 20728 KB Output is correct
124 Correct 5 ms 504 KB Output is correct
125 Correct 5 ms 504 KB Output is correct
126 Correct 5 ms 504 KB Output is correct