#include "dna.h"
#include<bits/stdc++.h>
using namespace std;
string s, t;
void init(std::string a, std::string b) {
s = a; t = b;
}
int get_distance(int x, int y) {
string a = s.substr(x, y - x + 1), b = t.substr(x, y - x + 1);
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if (a != b) return -1;
int cnt = 0;
for (int i = x; i <= y; i++) {
if (s[i] != t[i]) cnt++;
}
return (!cnt ? 0 : --cnt);
}
# | 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... |