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;
using ll = int;
ll n;
string a,b;
void init(std::string A, std::string B) {
a = A;
b = B;
}
int get_distance(int x, int y) {
string sa = a.substr(x,y-x+1);
string sb = b.substr(x,y-x+1);
if(sa==sb) return 0;
string u = sa,v = sb;
sort(u.begin(),u.end());
sort(v.begin(),v.end());
if (u!=v) return -1;
if(sa.size()==2) return 1;
if(sa.size()==3){
if (sa[0]==sb[0]||sa[1]==sb[1]||sa[2]==sb[2]) return 1;
return 2;
}
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... |