제출 #977634

#제출 시각아이디문제언어결과실행 시간메모리
977634efedmrlrGenetics (BOI18_genetics)C++17
19 / 100
2012 ms84832 KiB
#include <bits/stdc++.h> #define lli long long int #define ld long double #define pb push_back #define MP make_pair #define all(x) x.begin(), x.end() #define rall(x) x.begin(), x.end() #define REP(i, n) for(int i = 0; (i) < (n); (i)++) using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); } const int N = 4102; const int INF = 1e9 + 500; const int MOD = 1e9 + 7; array<bitset<N>, N> s; array<array<int, N>, N> dif; int n, m, k; bitset<N> tmp; bitset<N> vis; void solve() { cin >> n >> m >> k; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { char t; cin >> t; s[i][j] = (t == 'A'); } } REP(i, n) REP(j, n) dif[i][j] = -1; for(int i = 0; i < n; i++) { if(vis[i]) continue; for(int j = 0; j < n; j++) { if(i == j) continue; if(dif[i][j] == -1) { tmp = s[i] ^ s[j]; dif[i][j] = dif[j][i] = (int)tmp.count(); } if(dif[i][j] != k) { vis[i] = vis[j] = 1; } } if(!vis[i]) { cout << i + 1 << "\n"; return; } } } signed main() { fastio(); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...