| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 878179 | vjudge1 | Genetics (BOI18_genetics) | C++17 | 2079 ms | 25692 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>
using namespace std;
#define ll long long
#define pb push_back
// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx2")
const int N = 4100;
int n, m, k, idx[N];
string s[N];
bitset<N << 2> tmp, b[N];
mt19937 rng(time(0));
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; ++i) {
cin >> s[i];
idx[i] = i;
for (int j = 0; j < m; ++j) {
if (s[i][j] == 'A') {
b[i][j] = true;
}
else if (s[i][j] == 'G') {
b[i][j + m] = true;
}
else if (s[i][j] == 'C') {
b[i][j + 2 * m] = true;
}
else if (s[i][j] == 'T') {
b[i][j + 3 * m] = true;
}
}
}
shuffle(idx, idx + n, rng);
k = m - k;
for (int _ = 0; _ < n; ++_) {
int i = idx[_];
bool ok = true;
// cout << i << ' ';
for (int j = 0; j < n; ++j) {
if (i == j) {
continue;
}
if ((b[i] & b[j]).count() != k) {
ok = false;
break;
}
}
if (ok) {
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... | ||||
