Submission #1129465

#TimeUsernameProblemLanguageResultExecution timeMemory
1129465ozner77Mutating DNA (IOI21_dna)C++17
0 / 100
29 ms2368 KiB
#define ll long long #include <bits/stdc++.h> using namespace std; int n; string a1,b1; void init(string a,string b){ a1=a;b1=b; n=a.size(); } int get_distance(int x, int y){ x-=1; y-=1; if(x==y){ return 0; } map<int,int> M; map<int,int> M1; int res=0; for(int i=x;i<=y;i++){ M[a1[i]]++; M1[b1[i]]++; if(a1[i]!=b1[i]){ res++; } } bool com=false; for(auto x:M){ if(x.second==M1[x.first]){ continue; }else{ return -1; } } return res/2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...