Submission #545292

#TimeUsernameProblemLanguageResultExecution timeMemory
545292Clan328Mutating DNA (IOI21_dna)C++17
22 / 100
1553 ms3760 KiB
#include "dna.h" using namespace std; string A, B; void init(std::string a, std::string b) { A = a; B = b; } int get_distance(int x, int y) { int a = 0, b = 0, c = 0; int a2 = 0, b2 = 0, c2 = 0; for (int i = x; i <= y; i++) { if (A[i] != B[i]) { if (A[i] == 'A') a++; else if (A[i] == 'C') c++; else b++; if (B[i] == 'A') a2++; else if (B[i] == 'C') c2++; else b2++; } } if (a == a2 && b == b2 && c == c2) return (a+b+c)/2; else return -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...