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;
string A, B;
void init(std::string a, std::string b) {
A = a;
B = b;
}
int get_distance(int x, int y) {
int ans = 0;
map<int,int> M, M1;
for(int i = x; i <= y; i++) {
if(A[i] != B[i]) {
ans += 1;
}
M[A[i]] += 1;
M1[B[i]] += 1;
}
if(M['A'] != M1['A'] || M['T'] != M1['T']) {
return - 1;
}
else {
return ans / 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... |