| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 878222 | vjudge1 | Genetics (BOI18_genetics) | C++17 | 2004 ms | 12116 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
mt19937 ran(chrono::steady_clock::now().time_since_epoch().count());
const int N = 4100;
int n, m, k, idx[N];
string s[N];
bitset<N * 4> have[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; ++i) {
idx[i] = i;
cin >> s[i];
for (int j = 0; j < m; ++j) {
char c = s[i][j];
if (c == 'A') {
have[i][j] = true;
}
else if (c == 'G') {
have[i][j + m] = true;
}
else if (c == 'C') {
have[i][j + 2 * m] = true;
}
else if (c == 'T') {
have[i][j + 3 * m] = true;
}
}
}
shuffle(idx, idx + n, ran);
k = m - k;
for (int _ = 0; _ < n; ++_) {
int i = idx[_];
bool isAns = true;
for (int j = 0; j < n; ++j) {
if (i == j) {
continue;
}
if ((have[i] & have[j]).count() != k) {
isAns = false;
}
}
if (isAns == true) {
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... | ||||
