Submission #473639

#TimeUsernameProblemLanguageResultExecution timeMemory
473639elgamalsalmanGenetics (BOI18_genetics)C++14
0 / 100
2078 ms3188 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(1932); for (int ii = 0; ii <= 1e9 / n; ii++) { int i = rand() % n, j = rand() % n; 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...