Submission #720836

#TimeUsernameProblemLanguageResultExecution timeMemory
720836uroskMutating DNA (IOI21_dna)C++17
0 / 100
30 ms2268 KiB
#include "dna.h" #include <bits/stdc++.h> #define ll long long using namespace std; #define maxn 100005 ll n; ll ps[maxn][4][4]; map<char,ll> mp; void init(std::string a, std::string b) { mp['A'] = 1; mp['T'] = 2; mp['C'] = 3; for(ll i = 1;i<=n;i++){ ll ca = mp[a[i-1]]; ll cb = mp[b[i-1]]; for(ll j = 1;j<=3;j++){ for(ll k = 1;k<=3;k++){ ps[i][j][k] = ps[i-1][j][k]; } } ps[i][ca][cb]++; } } ll f[4][4]; int get_distance(int x, int y) { for(ll i = 1;i<=3;i++) for(ll j = 1;j<=3;j++) f[i][j] = ps[y][i][j] - ps[x][i][j]; if(f[1][2]!=f[2][1]) return -1; return f[1][2]; } /** 6 3 ATACAT ACTATA 1 3 4 5 3 5 **/
#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...