| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 878240 | vjudge1 | Genetics (BOI18_genetics) | C++17 | 648 ms | 35324 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 optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
const int N = 4100 + 10;
int n, m, k, cnt[N];
string s[N];
bitset<N> a[N];
int main() {
ios:: sync_with_stdio(0), cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; i++) cin >> s[i];
if (n >= 1801) {
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
if (s[i][j] == 'C') a[i][j] = 1;
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
if ((a[i] ^ a[j]).count() == k) cnt[i]++, cnt[j]++;
}
else {
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++) {
int tmp = 0;
for (int k = 0; k < s[i].size(); k++)
if (s[i][k] != s[j][k]) tmp++;
if (tmp == k) cnt[i]++, cnt[j]++;
}
}
for (int i = 0; i < n; i++)
if (cnt[i] == n - 1) {
cout << i + 1 << '\n';
break;
}
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... | ||||
