제출 #530029

#제출 시각아이디문제언어결과실행 시간메모리
530029OttoTheDinoGenetics (BOI18_genetics)C++17
27 / 100
2077 ms4096 KiB
#include <bits/stdc++.h> using namespace std; #define rep(i,s,e) for (int i = s; i <= e; ++i) #define rrep(i,s,e) for (int i = s; i >= e; --i) #define pb push_back #define pf push_front #define fi first #define se second #define all(a) a.begin(), a.end() typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<double> vd; typedef vector<string> vs; typedef vector<ll> vll; int main() { ios::sync_with_stdio(0); cin.tie(0); srand(4312); int n, m, k; cin >> n >> m >> k; bitset<4100> x[n][4]; unordered_map<char, int> mp; mp['A'] = 0; mp['C'] = 1; mp['G'] = 2; mp['T'] = 3; rep (i,0,n-1) { string s; cin >> s; rep (j,0,(int)s.size()-1) x[i][mp[s[j]]] |= bitset<4100>(1)<<j; } vi order(n); iota(all(order), 0); random_shuffle(all(order)); int s[n] = {}; rep (iii,0,n-1) { int i = order[iii]; if (s[i]) continue; bool suc = 1; rep (ij,0,n-1) { int j = order[ij]; if (i==j) continue; int cnt = 0; rep (l,0,3) cnt += (x[i][l]^x[j][l]).count(); if (cnt/2!=k) { s[j] = 1; suc = 0; } } if (suc) { cout << i+1 << "\n"; break; } } 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...