# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
703853 | mihai145 | Monkey and Apple-trees (IZhO12_apple) | C++14 | 5 ms | 10452 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.
//
// Created by mihai145 on 28.02.2023.
// Test problem: https://oj.uz/problem/view/IZhO12_apple
//
#include <iostream>
using namespace std;
const int NMAX = 2 * 100000;
class DynamicSegmentTree {
private:
int kNodes, v[4 * NMAX];
pair<int, int> sons[4 * NMAX];
bool lazy[4 * NMAX];
void init(int idx) {
sons[idx].first = ++kNodes;
sons[idx].second = ++kNodes;
}
void push(int idx, int l, int r) {
if (lazy[idx]) {
if (v[idx] != r - l + 1) {
v[idx] = r - l + 1;
lazy[sons[idx].first] = true;
lazy[sons[idx].second] = true;
lazy[idx] = false;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |