Submission #599606

#TimeUsernameProblemLanguageResultExecution timeMemory
599606FidanMutating DNA (IOI21_dna)C++17
35 / 100
39 ms4116 KiB
#include <bits/stdc++.h> #include "dna.h" using namespace std; typedef long long ll; const ll N=(1e5)+10; ll n; vector<ll> va(N, 0); vector<ll> vt(N, 0); void init(string a, string b) { n=a.length(); a="."+a; b="."+b; for(ll i=1; i<=n; i++){ va[i]=va[i-1]; vt[i]=vt[i-1]; if(a[i]=='T' && b[i]=='A') va[i]++; else if(a[i]=='A' && b[i]=='T') vt[i]++; } } int get_distance(int x, int y) { y++, x++; if(va[y]-va[x-1]!=vt[y]-vt[x-1]) return -1; else return va[y]-va[x-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...