# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
577483 | keta_tsimakuridze | Mutating DNA (IOI21_dna) | C++17 | 83 ms | 7380 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;
const int N = 3e5 + 5;
int tree[N][3][3], n;
void upd(int id, int t1, int t2) {
++id;
for(id; id <= n; id += id & (-id)) tree[id][t1][t2] ++;
}
int get(int id, int t1, int t2) {
++id;
int ans = 0;
for(id; id >= 1; id -= id & (-id)) ans += tree[id][t1][t2];
return ans;
}
void init(std::string a, std::string b) {
n = a.size();
for(int i = 0; i < n; i++) {
upd(i, (a[i] == 'A' ? 1 : a[i] == 'C' ? 0 : 2), (b[i] == 'A' ? 1 : b[i] == 'C' ? 0 : 2));
}
}
int get_distance(int x, int y) {
vector<vector<int> > a;
a.resize(3, vector<int> (3));
int ans = 0;
vector<int> X(3);
for(int t1 = 0; t1 < 3; t1++) {
for(int t2 = 0; t2 < 3; t2++) {
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... |