# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96561 | Kastanda | Genetics (BOI18_genetics) | C++11 | 664 ms | 32504 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.
// FAILED
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const int N = 4105;
int n, m, k;
ll R[N], H[4][N];
char A[N][N];
mt19937 Rnd(chrono::steady_clock::now().time_since_epoch().count());
int main()
{
scanf("%d%d%d", &n, &m, &k);
getchar();
for (int i = 1; i <= n; i++, getchar())
for (int j = 1; j <= m; j++)
{
int ch = getchar();
if (ch == 'A') ch = 0;
else if (ch == 'C') ch = 1;
else if (ch == 'G') ch = 2;
else ch = 3;
A[i][j] = ch;
}
ll tot = 0;
for (int i = 1; i <= n; i++)
R[i] = Rnd(), tot += R[i];
for (int j = 1; j <= m; j++)
for (int i = 1; i <= n; i++)
H[A[i][j]][j] += R[i];
for (int i = 1; i <= n; i++)
{
ll sum = 0;
for (int j = 1; j <= m; j++)
for (int h = 0; h <= 3; h ++)
if (A[i][j] != h)
sum += H[h][j];
if (sum == (tot - R[i]) * k)
return !printf("%d\n", i);
}
assert(0);
}
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... |