# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483559 | M_W | Mutating DNA (IOI21_dna) | C++17 | 40 ms | 6212 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;
int qs[100001][6]; // AT, TA, AC, CA, CT, TC
void init(string a, string b){
int len = a.size();
for(int i = 1; i <= len; i++){
for(int j = 0; j < 6; j++) qs[i][j] = qs[i - 1][j];
if(a[i - 1] == 'A'){
if(b[i - 1] == 'C') qs[i][2]++;
else if(b[i - 1] == 'T') qs[i][0]++;
}
else if(a[i - 1] == 'T'){
if(b[i - 1] == 'A') qs[i][1]++;
else if(b[i - 1] == 'C') qs[i][5]++;
}
else{
if(b[i - 1] == 'A') qs[i][3]++;
else if(b[i - 1] == 'T') qs[i][4]++;
}
}
}
int get_distance(int a, int b){
a++; b++;
int AT = qs[b][0] - qs[a - 1][0];
int TA = qs[b][1] - qs[a - 1][1];
int AC = qs[b][2] - qs[a - 1][2];
int CA = qs[b][3] - qs[a - 1][3];
int CT = qs[b][4] - qs[a - 1][4];
int TC = qs[b][5] - qs[a - 1][5];
# | 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... |