Submission #1013418

#TimeUsernameProblemLanguageResultExecution timeMemory
1013418vjudge1Mutating DNA (IOI21_dna)C++17
43 / 100
1553 ms3924 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; string sa, sb; void init(std::string a, std::string b) { sa = a, sb = b; } int get_distance(int x, int y) { int a1 = 0, a2 = 0, c1 = 0, c2 = 0, t1 = 0, t2 = 0, s = 0; for(int i = x; i <= y; ++i){ if(sa[i] == sb[i]) s++; if(sa[i] == 'A') a1++; else if (sa[i] == 'T') t1++; else c1++; if(sb[i] == 'A') a2++; else if (sb[i] == 'T') t2++; else c2++; } if(a1 != a2 || t1 != t2 || c1 != c2) return -1; else return ceil((y-x-s+1)/2.0); return 0; }
#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...