# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
825404 | QwertyPi | Genetics (BOI18_genetics) | C++14 | 2072 ms | 5296 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 MAXN = 1e5 + 11;
bitset<8200> A[4100];
bitset<8200> B, F1, F2;
int f(char c){
if(c == 'A') return 0;
if(c == 'C') return 1;
if(c == 'G') return 2;
if(c == 'T') return 3;
}
int32_t main(){
int n, m, k; cin >> n >> m >> k;
for(int j = 0; j < m; j++){
F1.set(j * 2, 1); F2.set(j * 2 + 1, 1);
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
char c; cin >> c;
int x = f(c);
A[i].set(j * 2, x % 2);
A[i].set(j * 2 + 1, x / 2);
}
}
for(int i = 0; i < n; i++){
bool ok = true;
for(int j = 0; j < n; j++){
if(i == j) continue;
B = A[i] ^ A[j];
B = (B & F1) | ((B & F2) >> 1);
if(B.count() != k){
ok = false;
break;
}
}
if(ok){
cout << i + 1 << endl;
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... |