# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
961292 | mgch | Genetics (BOI18_genetics) | C++14 | 2029 ms | 12124 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;
const int N = 4107, L = 26, K = 66, MOD = 1000000007;
char s[N][N];
int main() {
// freopen("input.txt", "r", stdin);
// ios::sync_with_stdio(false); cin.tie(0);
int n, m, k;
scanf("%d%d%d\n", &n, &m, &k);
vector <int> ord(n), rnk(n, 0);
iota(ord.begin(), ord.end(), 0);
for (int i = 0; i < n; ++i) {
scanf("%s\n", s[i]);
}
auto diff = [&](int x, int y) {
int ans = 0;
for (int i = 0; i < m; ++i) {
ans += s[x][i] != s[y][i];
}
return ans;
};
for (int it = 0; it < K; ++it) {
for (int i = 0; i + 1 < (int)ord.size(); ++i) {
if (diff(ord[i], ord[i + 1]) != k) {
++i;
continue;
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... |