# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
103638 | pavel | Genetics (BOI18_genetics) | C++14 | 2086 ms | 2552 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];
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){
bool ok=true;
for(int j=0;j<n;++j){
if(i!=j){
if((dna[i]^dna[j]).count()!=k){
ok=false;
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... |