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"
#include "dna.h"
using namespace std;
const int sz = 1e5 + 5;
int pa[sz], pt[sz];
int n;
string s, t;
void init(string a, string b) {
n = a.size();
s = ' ' + a, t = ' ' + b;
for (int i = 1; i <= n; i ++) {
pa[i] = pa[i - 1], pt[i] = pt[i - 1];
if ('A' == s[i] && 'T' == t[i]) {
pa[i] ++;
} else if ('T' == s[i] && 'A' == t[i]) {
pt[i] ++;
}
}
}
int get_distance(int x, int y) {
x ++, y ++;
int pac = pa[y] - pa[x - 1];
int ptc = pt[y] - pt[x - 1];
if (pac != ptc) {
return -1;
} else {
return pac;
}
}
# | 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... |