#include "dna.h"
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
string a, b;
vector<int> p(1e5);
void init(string A, string B){
a = A, b = B;
int n = a.size();
p[0] = (a[0] != b[0]);
for(int i = 1; i < n; i++) p[i] = p[i - 1] + (a[i] != b[i]);
}
int get_distance(int x, int y){
int cnt = p[y] - (x ? p[x - 1] : 0);
if(cnt % 2) return -1;
else return cnt / 2;
}
# | 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... |