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>
std::string A, B;
void init(std::string a, std::string b)
{
A = a;
B = b;
}
int get_distance(int x, int y)
{
int AswapCount = 0, TswapCount = 0;
for (int i = x; i <= y; ++i)
if (A[i] == 'A' && B[i] == 'T')
++AswapCount;
else if (A[i] == 'T' && B[i] == 'A')
++TswapCount;
if (AswapCount != TswapCount)
return -1;
return AswapCount;
}
# | 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... |