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;
typedef long long ll;
const ll N=(1e5)+10;
ll n;
vector<ll> va(N, 0);
vector<ll> vt(N, 0);
void init(string a, string b) {
n=a.length();
a="."+a;
b="."+b;
for(ll i=1; i<=n; i++){
va[i]=va[i-1];
vt[i]=vt[i-1];
if(a[i]=='T' && b[i]=='A') va[i]++;
else if(a[i]=='A' && b[i]=='T') vt[i]++;
}
}
int get_distance(int x, int y) {
y++, x++;
if(va[y]-va[x-1]!=vt[y]-vt[x-1]) return -1;
else return va[y]-va[x-1];
}
# | 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... |