# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
861725 | serifefedartar | Genetics (BOI18_genetics) | C++17 | 258 ms | 33632 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;
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define s second
#define f first
typedef long long ll;
const ll MOD = 1e9+9;
const ll LOGN = 20;
const ll MAXN = 4100 + 100;
const ll P = 31;
ll cnt[MAXN][4];
ll need = 0;
string dna[MAXN];
int main() {
fast
int N, M, K;
cin >> N >> M >> K;
ll now = 1;
for (int i = 1; i <= N; i++) {
now = (now * P) % MOD;
need = (need + (now * K % MOD)) % MOD;
cin >> dna[i];
dna[i] = "#" + dna[i];
for (int j = 1; j <= M; j++) {
if (dna[i][j] == 'A')
cnt[j][0] = (cnt[j][0] + now) % MOD;
# | 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... |