Submission #321328

#TimeUsernameProblemLanguageResultExecution timeMemory
321328NaynaGenetics (BOI18_genetics)C++14
19 / 100
2084 ms16680 KiB
#include <bits/stdc++.h> using namespace std; const int mxn = 3e5+5; typedef long long ll; bool vis[4001]; int main() { // input; // output; int n, m, k; cin >> n >> m >> k; vector<bitset<4105> >v; for(int i = 0; i < n; i++) { string s; cin >> s; bitset<4105>tmp; // cout << tmp << '\n'; for(int r = 0; r < m; r++) { if(s[r]=='A') tmp[r] = '1'; } v.push_back(tmp); } int ans = -1; for(int i = 0; i < n; i++) { int cnt = 0; if(vis[i]) continue; for(int r = 0; r < n; r++) { if(i==r) continue; bitset<4105>tmp = v[i]^v[r]; int x = tmp.count(); if(x==k) cnt++; else { vis[r] = 1; break; } } if(cnt==n-1) { ans = i+1; break; } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...