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"
#include <bits/stdc++.h>
using namespace std;
string sa, sb;
void init(std::string a, std::string b) {
sa = a, sb = b;
}
int get_distance(int x, int y) {
int a1 = 0, a2 = 0, c1 = 0, c2 = 0, t1 = 0, t2 = 0, s = 0;
for(int i = x; i <= y; ++i){
if(sa[i] == sb[i]) s++;
if(sa[i] == 'A') a1++;
else if (sa[i] == 'T') t1++;
else c1++;
if(sb[i] == 'A') a2++;
else if (sb[i] == 'T') t2++;
else c2++;
}
if(a1 != a2 || t1 != t2 || c1 != c2) return -1;
else return ceil((y-x-s+1)/2.0);
return 0;
}
# | 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... |