Submission #1129469

#TimeUsernameProblemLanguageResultExecution timeMemory
1129469ozner77Mutating DNA (IOI21_dna)C++20
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){ 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; } } if(res%2==0){ return res/2; }else{ return (res/2)+1; } }
#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...