제출 #103638

#제출 시각아이디문제언어결과실행 시간메모리
103638pavelGenetics (BOI18_genetics)C++14
19 / 100
2086 ms2552 KiB
#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; } } }

컴파일 시 표준 에러 (stderr) 메시지

genetics.cpp: In function 'int main()':
genetics.cpp:30:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if((dna[i]^dna[j]).count()!=k){
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
genetics.cpp:14: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:17: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...