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;
string a, b;
void init(string a1, string b1) {
a = a1; b = b1;
}
int get_distance(int x, int y) {
ll offA = 0;
for (int i = x; i <= y; i++) {
if (a[i] == 'A') offA++;
if (b[i] == 'A') offA--;
}
if (offA != 0) return -1;
ll cnt = 0;
for (int i = x; i <= y; i++) {
if (a[i] != b[i]) cnt++;
}
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... |