# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
80661 | FutymyClone | Genetics (BOI18_genetics) | C++14 | 2097 ms | 9464 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>
using namespace std;
const int N = 4105;
int n, m, k;
char a[N][N];
bitset <N> bs[N][4];
int toint (char c) {
if (c == 'A') return 0;
if (c == 'C') return 1;
if (c == 'G') return 2;
return 3;
}
int solve (int i, int j) {
int ans = bs[i][0].count() - (bs[i][0] & bs[j][0]).count();
ans = ans + bs[i][1].count() - (bs[i][1] & bs[j][1]).count();
ans = ans + bs[i][2].count() - (bs[i][2] & bs[j][2]).count();
ans = ans + bs[i][3].count() - (bs[i][3] & bs[j][3]).count();
return ans;
}
int main(){
scanf("%d %d %d", &n, &m, &k);
for (int i = 1; i <= n; i++) scanf("%s", a[i]);
for (int i = 1; i <= n; i++) {
for (int j = 0; j < m; j++) {
bs[i][toint(a[i][j])].set(j);
}
}
for (int i = 1; i <= n; i++) {
bool ok = true;
for (int j = 1; j <= n; j++) {
if (i == j) continue;
if (solve(i, j) != k) {
ok = false;
break;
}
}
if (ok) return !printf("%d", i);
}
return 0;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |