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>
#define DIM 4200
using namespace std;
char a[DIM][DIM],ch[5];
int cnt[DIM][DIM];
bitset <DIM> v[DIM];
int n,m,k,i,j;
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n>>m>>k;
for (i=1;i<=n;i++)
cin>>a[i]+1;
ch[1] = 'A', ch[2] = 'C', ch[3] = 'G', ch[4] = 'T';
for (int pas=1;pas<=4;pas++){
for (i=1;i<=n;i++){
v[i].reset();
for (j=1;j<=m;j++){
if (a[i][j] == ch[pas])
v[i][j] = 1;
}}
for (i=1;i<=n;i++)
for (j=i+1;j<=n;j++){
int val = (v[i] & v[j]).count();
//int val = __builtin_popcount (v[i] & v[j]);
cnt[i][j] += val;
cnt[j][i] += val;
}
}
for (i=1;i<=n;i++){
int ok = 1;
for (j=1;j<=n;j++)
if (i != j && cnt[i][j] != m - k){
ok = 0;
break;
}
if (ok){
cout<<i;
break;
}
}
return 0;
}
Compilation message (stderr)
genetics.cpp: In function 'int main()':
genetics.cpp:17:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
17 | cin>>a[i]+1;
| ~~~~^~
# | 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... |