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;
typedef long long ll;
const ll MX_N = 1e5;
ll ps[MX_N];
void init(std::string a, std::string b) {
ll n = a.size();
for(ll i=0;i<n;i++)
{
if(a[i]!=b[i])
ps[i] = 1;
if(i) ps[i]+=ps[i-1];
}
}
int get_distance(int x, int y) {
ll diff = ps[y];
if(x) diff -= ps[x-1];
return diff-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... |