제출 #545292

#제출 시각아이디문제언어결과실행 시간메모리
545292Clan328DNA 돌연변이 (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...