# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473324 | Hamed5001 | Genetics (BOI18_genetics) | C++14 | 2082 ms | 5588 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;
typedef long long ll;
int check(string& _1, string& _2) {
int ret = 0;
for (int i = 0; i < _1.size(); i++)
ret += (_1[i] != _2[i]);
return ret;
}
void solve() {
int N, M, K;
cin >> N >> M >> K;
vector<string> DNA(N);
for (auto& dna : DNA) cin >> dna;
for (int i = 0; i < N; i++) {
bool found = 1;
for (int j = 0; j < N && found; j++) {
if (i == j) continue;
found &= (check(DNA[i], DNA[j]) == K);
}
if (found) return void(cout << i+1);
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
solve();
}
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... |