# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
103639 | pavel | Genetics (BOI18_genetics) | C++14 | 83 ms | 1144 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 <cstdio>
#include <bitset>
using namespace std;
const int MAXN = 4103;
const int MAXM = 4103;
int n,m,k;
bitset<MAXM> dna[MAXN];
bool skip[MAXN];
int main(){
scanf("%d%d%d", &n, &m, &k);
for(int i=0;i<n;++i){
char tmp[MAXM];
scanf("%s", tmp);
for(int j=0;j<m;++j){
if(tmp[j]=='A'){
dna[i].set(j, false);
}else{
dna[i].set(j, true);
}
}
}
for(int i=0;i<n;++i){
if(skip[i]) continue;
bool ok=true;
for(int j=n-1;j>=0;++j){
if(i!=j){
if((dna[i]^dna[j]).count()!=k){
ok=false;
skip[j]=true;
break;
}
}
}
if(ok){
printf("%d\n", i+1);
break;
}
}
}
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... |