제출 #1131438

#제출 시각아이디문제언어결과실행 시간메모리
1131438Alihan_8Genetics (BOI18_genetics)C++20
19 / 100
2092 ms2372 KiB
#include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(), x.end()
#define ar array
#define pb push_back
#define ln '\n'
#define size(x) (int)(x).size()
#define int long long

typedef pair <int,int> pii;

using i64 = long long;

template <class F, class _S>
bool chmin(F &u, const _S &v){
    bool flag = false;
    if ( u > v ){
        u = v; flag |= true;
    }
    return flag;
}

template <class F, class _S>
bool chmax(F &u, const _S &v){
    bool flag = false;
    if ( u < v ){
        u = v; flag |= true;
    }
    return flag;
}

using bs = bitset <4103>;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
	int n, m, k; cin >> n >> m >> k;
	
	vector <bs> b(n);
	
	for ( int i = 0; i < n; i++ ){
		string s; cin >> s;
		
		for ( int j = 0; j < m; j++ ){
			if ( s[j] == 'C' ) b[i][j] = 1;
		}
	}
	
	for ( int i = 0; i < n; i++ ){
		bool bad = false;
		
		for ( int j = 0; j < n; j++ ){
			if ( i == j ) continue;
			
			if ( (int)(b[i] ^ b[j]).count() != k ){
				bad = 1; break;
			}
		}
		
		if ( !bad ) return cout << i + 1 << "\n", 0;
	}
	
	assert(false);
    	
    cout << '\n';
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...