# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1177589 | Pannda | Monkey and Apple-trees (IZhO12_apple) | C++20 | 191 ms | 83060 KiB |
#include <bits/stdc++.h>
using namespace std;
template <class Info, class Tag>
struct ImplitcitLazySegmentTree {
struct Node {
Info info = Info();
Tag tag = Tag();
int ln = 0, rn = 0;
};
int n;
vector<Node> nodes;
ImplitcitLazySegmentTree(int n) : n(n), nodes(1) {
int root;
newNode(root, 0, n);
}
void apply(int p, const Tag &t) {
nodes[p].info.apply(t);
nodes[p].tag.apply(t);
}
void pull(int p) {
nodes[p].info = nodes[nodes[p].ln].info + nodes[nodes[p].rn].info;
}
void push(int p) {
apply(nodes[p].ln, nodes[p].tag);
apply(nodes[p].rn, nodes[p].tag);
nodes[p].tag = Tag();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |