Submission #103642

#TimeUsernameProblemLanguageResultExecution timeMemory
103642pavelGenetics (BOI18_genetics)C++14
0 / 100
269 ms1016 KiB
#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=i+1;j<n;++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)

genetics.cpp: In function 'int main()':
genetics.cpp:32:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if((dna[i]^dna[j]).count()!=k){
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
genetics.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d", &n, &m, &k);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
genetics.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s", tmp);
         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...