제출 #593860

#제출 시각아이디문제언어결과실행 시간메모리
593860AlesL0Genetics (BOI18_genetics)C++17
0 / 100
247 ms3608 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, m, k; cin >> n >> m >> k;
    bitset <4100> b[n];
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m; j++){
            char c; cin >> c;
            if (c == 'A')b[i].set(j);
        }
    }
    vector <bool> good(n, 1);
    for (int i = 0; i < n; i++){
        if (!good[i])continue;
        bool flag10 = 1;
        for (int j = i+1; j < n; j++){
            if ((b[i]^b[j]).count() != k){
                good[j] = 0; flag10 = 0; 
                break;
            }
        }
        if (flag10){
            cout << i+1; 
            return 0;
        }
    }
}

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

genetics.cpp: In function 'int main()':
genetics.cpp:24:37: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   24 |             if ((b[i]^b[j]).count() != k){
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...