Submission #530026

#TimeUsernameProblemLanguageResultExecution timeMemory
530026OttoTheDinoGenetics (BOI18_genetics)C++17
27 / 100
2072 ms3408 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); 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; } int s[n] = {}; rep (i,0,n-1) { if (s[i]) continue; bool suc = 1; rep (j,0,n-1) { 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...