# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1095278 | vjudge1 | Genetics (BOI18_genetics) | C++17 | 0 ms | 0 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>
#ifndef ONLINE_JUDGE
#include "/Users/quocbaonguyentran/Documents/VOI25/template/debug.cpp"
#else
#define debug(...) ;
#endif
using namespace std;
#define endl "\n"
#define ll long long
mt19937 rng(chrono::high_resolution_clock().now().time_since_epoch().count());
#define rand(a, b) uniform_int_distribution<ll>(a, b)(rng)
ll n, m, k;
string s[4105];
int kc[4105][4105];
ll w[4105];
ll vt[30][4105];
char v[] = {'A', 'C', 'G', 'T'};
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> m >> k;
ll sum = 0;
for (int i = 1; i <= n; i++)
{
cin >> s[i];
s[i] = " " + s[i];
w[i] = rand(1000, 1e12);
sum += w[i];
for (int j = 1; j <= m; j++)
{
vt[s[i][j] - 'A'][j] += w[i];
}
}
for (int i = 1; i <= n; i++)
{
ll ss = 0;
for (int j = 1; j <= m; j++)
{
ss += vt[s[i][j] - 'A'][j] - w[i];
}
if (ss == (sum - w[i]) * (m - k))
{
cout << i;
break;
}
}
}