# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
416804 | SirCovidThe19th | Genetics (BOI18_genetics) | C++14 | 723 ms | 47952 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;
long long n, m, k, idx[100], r[4105], hsh[4105][4], tot; string s[4105];
int main() {
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
cin >> n >> m >> k;
idx['A'] = 0; idx['G'] = 1; idx['C'] = 2; idx['T'] = 3;
for (int i = 0; i < n; i++){
cin >> s[i];
r[i] = uniform_int_distribution<long long>(1e3, 1e10)(rng); tot += r[i];
for (int j = 0; j < m; j++) hsh[j][idx[s[i][j]]] += r[i];
}
for (int i = 0; i < n; i++){
long long val = 0;
for (int j = 0; j < m; j++) val += tot-hsh[j][idx[s[i][j]]];
if (val == k*(tot-r[i])){ cout<<i+1; 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... |