# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034489 | anango | Genetics (BOI18_genetics) | C++17 | 2060 ms | 7048 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>
#define int long long
using namespace std;
int INF = 1LL<<30;
int match(string &s1, string &s2) {
int ct=0;
for (int i=0; i<s1.size(); i++) {
ct+=s1[i]!=s2[i];
}
return ct;
}
signed main() {
/*#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif*/
#ifdef ONLINE_JUDGE
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif //fast IO
int n,m,k; cin >> n >> m >> k;
vector<string> ar(n);
for (int i=0; i<n; i++) {
cin >> ar[i];
}
for (int i=0; i<n; i++) {
int gg = 1;
for (int j=0; j<n; j++) {
if (i==j) continue;
if (match(ar[i],ar[j])!=k) {
gg=0;
break;
}
}
if (gg) {
cout << i+1 << endl;
break;
}
}
}
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... |