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;
typedef long long ll;
typedef vector<int> vi;
#define MAXI (int)1e5
#define pb(x) push_back(x)
string s1;
string s2;
void init(string x,string y){
s1 = x;
s2 = y;
}
int get_distance(int x,int y){
map<char,int> m1,m2;
m1.insert({'A',0});
m2.insert({'A',0});
m1.insert({'T',0});
m2.insert({'T',0});
m1.insert({'C',0});
m2.insert({'C',0});
for(int i =x;i<=y;i++){
m1[s1[i]]++;
m2[s2[i]]++;
}
if(m1['A'] != m2['A'] || m1['T'] != m2['T'] || m1['C'] != m2['C']) return -1;
int cntr = 0;
for(int i = x;i<=y;i++){
if(s1[i] != s2[i]) cntr++;
}
if(cntr == 3) return 2;
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... |