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 <iostream>
using namespace std;
string s="",c="";
int a2[1001000]; int b2[1001000];
void init(string a, string b) {
s=a;
c=b; int n=s.size();
int g=0;
for(int i=0;i<n;i++)
{
if(s[i]!=c[i])
g++;
a2[i]=g;
}
}
int get_distance(int x, int y) {
int m=a2[y]-a2[x]+(s[x]!=c[x]);
if(m%2) return -1;
else
return m/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... |