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>
using namespace std;
const int N = 1e5+5;
// int a_s[N], c_s[N], t_s[N], a_s2[N], c_s2[N], t_s2[N], diff[N];
string s, s2;
void init(string a, string b){
s = a, s2 = b;
}
int get_distance(int x, int y){
int sm = 0, sm2 = 0, sm3 = 0;
for(int i = x; i <= y; ++i){
if(s[i] == 'A')
sm++;
if(s2[i] == 'A')
sm--;
if(s[i] == 'C')
sm2++;
if(s2[i] == 'C')
sm2--;
if(s[i] == 'T')
sm3++;
if(s2[i] == 'T')
sm3--;
}
if(sm or sm2 or sm3)
return -1;
int answer = 1;
for(int i = x; i <= y; ++i)
answer += (s[i] != s2[i]);
answer /= 2;
return answer;
}
# | 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... |