# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
21879 | ulna | Monkey and Apple-trees (IZhO12_apple) | C++11 | 466 ms | 138244 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;
// why am I so weak
int m;
struct node {
int sum;
int lazy;
node *left, *right;
node(int sum) : sum(sum), lazy(-1) {left = right = NULL;}
} *root = new node(0);
void push(node *u, int x, int y) {
if (u->lazy < 0) return;
int mid = (x + y) >> 1;
u->left->lazy = u->right->lazy = 1;
u->left->sum = mid - x + 1;
u->right->sum = y - mid;
u->lazy = -1;
}
int query(node *u, int x, int y, int l, int r) {
if (!u) return 0;
if (l > y || r < x) return 0;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |