# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1131101 | ozner77 | Mutating DNA (IOI21_dna) | C++20 | 0 ms | 0 KiB |
#define ll long long
#include <bits/stdc++.h>
using namespace std;
int n;
string a1,b1;
vector<int> V;
void init(string a,string b){
a1=a;b1=b;
V.push_back(0);
for(int i=0;i<a1.size();i++){
if(a1[i]!=b1[i]){
V.push_back(V[i]+1);
}else{
V.push_back(V[i]);
}
}
}
int get_distance(int x, int y){
x++;
y++;
int res=V[y]-V[x-1];
if(res%2==0)return res/2;
return res/2+1;
}
int main(){
init("TCAAT","ATCTA");
int res=get_distance(0,4);
cout<<res<<"\n";
}
//no saco 100 porque pase todo el dia con el minimun spanning porqueria y quiero ir a celebrar navidad bye
//https://oj.uz/problem/view/IOI21_dna