# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
643681 | rociohdz | Mutating DNA (IOI21_dna) | C++17 | 42 ms | 3872 KiB |
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>
#define pb push_back
using namespace std;
vector<char>s1, s2;
void init(std::string a, std::string b) {
for( int i = 0; i < a.size(); i++ ){
s1.pb(a[i]);
s2.pb(b[i]);
}
}
int get_distance(int x, int y) {
vector<char>v1,v2;
int cont=0;
for(int i=x;i<=y;i++){
if(s1[i]!=s2[i])cont++;
v1.push_back(s1[i]);
v2.push_back(s2[i]);
}
sort(v1.begin(),v1.end());
sort(v2.begin(),v2.end());
for(int i=0;i<v1.size();i++){
if(v1[i] != v2[i]) return -1;
}
return cont-1;
}
Compilation message (stderr)
# | 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... |