제출 #1154283

#제출 시각아이디문제언어결과실행 시간메모리
1154283curious_tigerDNA 돌연변이 (IOI21_dna)C++20
0 / 100
20 ms7232 KiB
#include "dna.h" #include<bits/stdc++.h> using namespace std; string given, target; vector<pair<long long, long long>> count_a (100001), count_t (100001), count_c (100001); void init(string a, string b) { given = a; target = b; for (int i=0; i<a.size(); i++) { if (a[i]=='A') count_a[i].first+=1; else if (a[i]=='T') count_t[i].first+=1; else count_c[i].first+=1; if (b[i]=='A') count_a[i].second+=1; else if (b[i]=='T') count_t[i].second+=1; else count_c[i].second+=1; } } int get_distance(int x, int y) { if (((count_a[y].first-count_a[x].first)==(count_a[y].second-count_a[x].second)) && ((count_t[y].first-count_t[x].first)==(count_t[y].second-count_t[x].second)) && ((count_c[y].first-count_c[x].first)==(count_c[y].second-count_c[x].second))) { if (y-x<=2) { if (given[y]==target[y]) return 0; else return 1; } } else { return -1; } 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...