Submission #1053227

#TimeUsernameProblemLanguageResultExecution timeMemory
1053227ZicrusMutating DNA (IOI21_dna)C++17
22 / 100
1578 ms2396 KiB
#include <bits/stdc++.h> #include "dna.h" using namespace std; typedef long long ll; string a, b; void init(string a1, string b1) { a = a1; b = b1; } int get_distance(int x, int y) { ll offA = 0; for (int i = x; i <= y; i++) { if (a[i] == 'A') offA++; if (b[i] == 'A') offA--; } if (offA != 0) return -1; ll cnt = 0; for (int i = x; i <= y; i++) { if (a[i] != b[i]) cnt++; } return cnt / 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...