| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 416794 | SirCovidThe19th | Genetics (BOI18_genetics) | C++14 | 468 ms | 41828 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;
int n, m, k, idx[100]; string s[4005]; long long r[4005], hsh[4005][4], tot;
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... | ||||
