# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951572 | mocha | Genetics (BOI18_genetics) | C++14 | 2028 ms | 30452 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 mx = 4105;
int n, m, k;
int a[mx][mx];
string st[mx];
int main() {
cin.tie(0);ios::sync_with_stdio(0);
cin >> n >> m >> k;
for (int i=0;i<n;i++) {
cin >> st[i];
}
for (int i=0;i<m;i++) {
for (int j=0;j<n;j++) {
for (int k=0;k<n;k++) {
if (st[j][i] != st[k][i]) {
a[j][k]++;
}
}
}
}
int ans = -1;
for (int i=0;i<n;i++) {
bool fl = 1;
for (int j=0;j<n;j++) {
if (i == j) continue;
if (a[i][j] != k) {
fl = 0;
break;
}
}
if (fl) {
cout << i+1 << "\n";
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... |