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"
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 a = 0, b = 0, c = 0;
int a2 = 0, b2 = 0, c2 = 0;
for (int i = x; i <= y; i++) {
if (A[i] != B[i]) {
if (A[i] == 'A') a++;
else if (A[i] == 'C') c++;
else b++;
if (B[i] == 'A') a2++;
else if (B[i] == 'C') c2++;
else b2++;
}
}
if (a == a2 && b == b2 && c == c2)
return (a+b+c)/2;
else
return -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... |