# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96067 | Shafin666 | Monkey and Apple-trees (IZhO12_apple) | C++14 | 806 ms | 251236 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>
#define mp make_pair
#define pb push_back
#define pii pair<ll, ll>
#define to second
#define cost first
typedef long long ll;
typedef long double ld;
using namespace std;
struct Node {
ll sum, lazy;
Node *l, *r;
Node() : sum(0), lazy(0), l(NULL), r(NULL) { }
}; Node *root;
void propagate(Node *v, ll len) {
if(v->lazy) {
if(v->l == NULL) v->l = new Node;
v->l->sum = len/2;
v->l->lazy = 1;
if(v->r == NULL) v->r = new Node;
v->r->sum = len/2;
v->r->lazy = 1;
v->sum = len;
v->lazy = 0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |