# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
669127 | thiago_bastos | Crayfish scrivener (IOI12_scrivener) | C++17 | 425 ms | 157736 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 <bits/stdc++.h>
using namespace std;
const int N = 24 * 1e6, M = 1e6;
int nr = 1, roots[M+10], len[M+10], le[N], ri[N], cur;
char letter[N];
int build(int l, int r) {
int p = cur++;
if(l != r) {
int m = (l + r) / 2;
le[p] = build(l, m);
ri[p] = build(m + 1, r);
}
return p;
}
int upd(int k, char c, int l, int r, int p) {
int np = cur++;
le[np] = le[p], ri[np] = ri[p];
if(l == r) letter[np] = c;
else {
int m = (l + r) / 2;
if(k <= m) le[np] = upd(k, c, l, m, le[p]);
else ri[np] = upd(k, c, m + 1, r, ri[p]);
}
return np;
}
# | 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... |