제출 #438137

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