# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867474 | thegamercoder19 | Mutating DNA (IOI21_dna) | C++17 | 18 ms | 7628 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;
vector<vector<int>> prefix;
void init(std::string a, std::string b) {
prefix.resize(3, vector<int>(a.size()+1));
for(int i=0; i<a.size(); i++) {
for(int j=0; j<3; j++) {
prefix[j][i+1] = prefix[j][i];
}
prefix[a[i]-'A'][i+1]++;
prefix[b[i]-'A'][i+1]--;
}
}
int get_distance(int x, int y) {
int dist = 0;
for(int i=0; i<3; i++) {
dist += abs(prefix[i][y+1] - prefix[i][x]);
}
return dist/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... |