# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
438181 | BrunoPloumhans | Mutating DNA (IOI21_dna) | C++17 | 42 ms | 5124 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 MAXN = 100000;
char achars[] = { 'A', 'A', 'T', 'T', 'C', 'C' };
char bchars[] = { 'T', 'C', 'A', 'C', 'A', 'T' };
int sums[MAXN+1][6];
void init(std::string a, std::string b) {
for (int i = 0; i < a.length(); ++i) {
for (int j = 0; j < 6; ++j) {
sums[i+1][j] = sums[i][j] + (a[i] == achars[j] && b[i] == bchars[j]);
}
}
}
inline int get(int x, int y, int idx) {
return sums[y+1][idx] - sums[x][idx];
}
inline void apply_pair(int& p1, int& p2, int& tot) {
int app = min(p1, p2);
p1 -= app;
p2 -= app;
tot += app;
//cout << "Paired " << app << endl;
}
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... |