제출 #1072013

#제출 시각아이디문제언어결과실행 시간메모리
1072013Ahmed57DNA 돌연변이 (IOI21_dna)C++17
0 / 100
23 ms4564 KiB
#include "bits/stdc++.h" using namespace std; vector<int> A,B; void init(string a, string b){ for(auto i:a){ if(i=='A')A.push_back(0); else if(i=='T')A.push_back(1); else A.push_back(2); } for(auto i:b){ if(i=='A')B.push_back(0); else if(i=='T')B.push_back(1); else B.push_back(2); } } int get_distance(int x, int y){ long long all =0; int lol[3][3]; memset(lol,0,sizeof lol); for(int i = x;i<=y;i++){ lol[A[i]][B[i]]++; } for(int i = 0;i<3;i++){ lol[i][i] = 0; for(int j = i+1;j<3;j++){ int mi = min(lol[i][j],lol[j][i]); all+=mi; lol[i][j]-=mi; lol[j][i]-=mi; } } int su = 0; for(int i = 0;i<3;i++){ for(int j = 0;j<3;j++){ su+=lol[i][j]; } } all+=su/3*2; return all; }
#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...