# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
440030 | algorithm16 | Mutating DNA (IOI21_dna) | C++17 | 67 ms | 8752 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dna.h"
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string a1,b1,s="ACT";
int n,cnt[3][2][100005],p[3][3][100005];
int get_cnt(int ind1,int ind2,int l,int r) {
if(!l) return cnt[ind1][ind2][r];
return cnt[ind1][ind2][r]-cnt[ind1][ind2][l-1];
}
int get_p(int ind1,int ind2,int l,int r) {
if(!l) return p[ind1][ind2][r];
return p[ind1][ind2][r]-p[ind1][ind2][l-1];
}
void init(std::string a, std::string b) {
n=a.size();
for(int i=0;i<n;i++) {
for(int j=0;j<3;j++) {
if(a[i]==s[j]) cnt[j][0][i]=1;
if(b[i]==s[j]) cnt[j][1][i]=1;
}
for(int j=0;j<3;j++) {
for(int k=0;k<2;k++) {
if(i) cnt[j][k][i]+=cnt[j][k][i-1];
}
}
for(int j=0;j<3;j++) {
for(int k=0;k<3;k++) {
if(j!=k && a[i]==s[j] && b[i]==s[k]) p[j][k][i]=1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |