# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601388 | penguinhacker | Genetics (BOI18_genetics) | C++17 | 2025 ms | 38984 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#pragma GCC target("popcnt")
using namespace std;
#define ll long long
#define ar array
const int mxN=4100;
int n, m, k, mp[256];
string s[mxN];
bitset<mxN> oc[mxN][4];
bool bad[mxN];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
mp['A']=0, mp['C']=1, mp['T']=2, mp['G']=3;
cin >> n >> m >> k;
for (int i=0; i<n; ++i) {
cin >> s[i];
for (int j=0; j<m; ++j)
oc[i][mp[s[i][j]]][j]=1;
}
for (int i=0; i<n; ++i) {
if (bad[i])
continue;
for (int j=0; j<n; ++j)
if (i!=j) {
int same=0;
for (int l=0; l<4; ++l)
same+=(oc[i][l]&oc[j][l]).count();
if (m-same!=k) {
bad[i]=bad[j]=1;
break;
}
}
if (!bad[i]) {
cout << i+1;
return 0;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |