Submission #438137

#TimeUsernameProblemLanguageResultExecution timeMemory
438137josiftepeMutating DNA (IOI21_dna)C++17
43 / 100
1583 ms2372 KiB
#include <iostream> #include <vector> #include <algorithm> #include <cstring> #include "dna.h" #include <map> using namespace std; const int maxn = 1e5 + 5; string a, b; int n; void init(string _a, string _b) { n = (int) a.size(); a = _a; b = _b; } int get_distance(int x, int y) { map<char, int> a_m, b_m; for(int i = x; i <= y; i++) { a_m[a[i]]++; b_m[b[i]]++; } if(a_m['A'] != b_m['A']) return -1; if(a_m['C'] != b_m['C']) return -1; if(a_m['T'] != b_m['T']) return -1; int diff = 0; for(int i = x; i <= y; i++) { if(a[i] != b[i]) { ++diff; } } return (diff + 1) / 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...