# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446778 | binsjl | Mutating DNA (IOI21_dna) | C++17 | 40 ms | 4912 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 <string>
#include <cstdlib>
using namespace std;
int A[2][100005], C[2][100005], AC[100005], same[100005];
void init(string a, string b) {
int n = a.length();
for (int i = 0; i < n; i++) {
A[0][i + 1] = A[0][i];
A[1][i + 1] = A[1][i];
C[0][i + 1] = C[0][i];
C[1][i + 1] = C[1][i];
AC[i + 1] = AC[i];
same[i + 1] = same[i];
if (a[i] == 'A')
A[0][i + 1]++;
if (b[i] == 'A')
A[1][i + 1]++;
if (a[i] == 'C')
C[0][i + 1]++;
if (b[i] == 'C')
C[1][i + 1]++;
if (a[i] == 'A' && b[i] == 'C')
AC[i + 1]++;
if (a[i] == 'C' && b[i] == 'A')
AC[i + 1]--;
if (a[i] == b[i])
# | 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... |