# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499831 | sazid_alam | DNA 돌연변이 (IOI21_dna) | C++17 | 40 ms | 6528 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 <bits/stdc++.h>
using namespace std;
string a, b;
int tot[100005][3][2], bad[100005];
void init(string u, string v) {
for(int i = 0; i < u.size(); i++){
bad[i + 1] += bad[i];
if(u[i] != v[i]) bad[i + 1]++;
if(u[i] == 'A') tot[i + 1][0][0]++;
if(v[i] == 'A') tot[i + 1][0][1]++;
if(u[i] == 'C') tot[i + 1][1][0]++;
if(v[i] == 'C') tot[i + 1][1][1]++;
if(u[i] == 'T') tot[i + 1][2][0]++;
if(v[i] == 'T') tot[i + 1][2][1]++;
for(int j = 0; j < 3; j++){
tot[i + 1][j][0] += tot[i][j][0];
tot[i + 1][j][1] += tot[i][j][1];
}
}
}
int get_distance(int x, int y) {
for(int j = 0; j < 3; j++){
if(tot[y + 1][j][0] - tot[x][j][0] != tot[y + 1][j][1] - tot[x][j][1]) return -1;
}
return (bad[y + 1] - bad[x] + 1) / 2;
}
Compilation message (stderr)
# | 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... |