Submission #473637

#TimeUsernameProblemLanguageResultExecution timeMemory
473637elgamalsalmanGenetics (BOI18_genetics)C++14
0 / 100
125 ms3208 KiB
#include <bits/stdc++.h> using namespace std; int n, m, k, score[4150]; string codes[4150]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m >> k; for (int i = 0; i < n; i++) { cin >> codes[i]; } srand(2004); for (int ii = 0; ii <= 1e8 / (n * n); ii++) { int i = rand() % n; for (int j = 0; j < n; j++) { if (i == j) continue; int diffCount = 0; for (int k = 0; k < m; k++) if (codes[i][k] != codes[j][k]) diffCount++; if (diffCount == k) { score[j]++; score[i]++; } } } //for (int i = 0; i < n; i++) cerr << "// score[" << i << "] : " << score[i] << '\n'; cout << distance(score, max_element(score, score + n)) + 1 << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...