# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
438111 | mango_lassi | Mutating DNA (IOI21_dna) | C++17 | 62 ms | 6072 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 "dna.h"
#include <bits/stdc++.h>
using namespace std;
vector<array<int, 9>> cou;
int getInd(char c) {
if (c == 'A') return 0;
if (c == 'C') return 1;
if (c == 'T') return 2;
assert(false);
return -1;
}
void init(string a, string b) {
int n = a.size();
cou.resize(n + 1);
for (int x = 0; x < 9; ++x) cou[0][x] = 0;
for (int j = 1; j <= n; ++j) {
for (int x = 0; x < 9; ++x) cou[j][x] = cou[j-1][x];
int va = getInd(a[j-1]);
int vb = getInd(b[j-1]);
++cou[j][va + 3*vb];
}
}
int get_distance(int x, int y) {
array<int, 9> counts = cou[y + 1];
for (int j = 0; j < 9; ++j) counts[j] -= cou[x][j];
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |