#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
typedef string str;
typedef vector<int> vi;
str a, b;
void init(std::string a1, std::string b2)
{
a = a1;
b = b2;
}
int get_distance(int x, int y)
{
str a1 = a.substr(x, y);
str b1 = b.substr(x, y);
int n = a1.length(), c = 0;
if (set<char>(a1.begin(), a1.end()).size() != set<char>(b1.begin(), b1.end()).size())
return -1;
for (int i = 0; i < n; i++)
{
if (a1[i] != b1[i])
{
a1[a1.find(b1[i])] = a1[i];
a1[i] = b1[i];
c++;
}
}
return c;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1603 ms |
3672 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1603 ms |
3672 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |