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 <bits/stdc++.h>
#define pb push_back
using namespace std;
bool mo = false;
string xx,yy;
void init(std::string a, std::string b) {
xx = a; yy = b;
}
int get_distance(int x, int y) {
if(mo)return -1;
int c = 0;
for(int i=x; i<=y; i ++){
if(xx[i] != yy[i]) c++;
}
map<char,int> q,w;
for(int i=x; i<=y; i++) q[xx[i]]++,w[yy[i]]++;
if(q != w) {
return -1;
}
return c-1;
}
// int main(){
// string a,b; cin >> a >> b;
// init(a,b);
// int q; cin >> q;
// while(q--){
// int x,y; cin >> x >> y;
// cout << get_distance(x,y) << '\n';
// }
// 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... |