# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1163386 | canhnam357 | Monkey and Apple-trees (IZhO12_apple) | C++17 | 157 ms | 67496 KiB |
// source problem :
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define lb lower_bound
#define ub upper_bound
#define MASK(i) (1LL << (i))
void ckmax(int& f, int s)
{
f = (f > s ? f : s);
}
void ckmin(int& f, int s)
{
f = (f < s ? f : s);
}
const int N = 1e5;
const int D = 61;
int f[N * D] = {}, lc[N * D] = {}, rc[N * D] = {}, lz[N * D] = {}, cnt = 1;
void down(int id, int sz)
{
if (!lz[id]) return;
if (!lc[id]) lc[id] = cnt++;
if (!rc[id]) rc[id] = cnt++;
lz[lc[id]] = 1;
f[lc[id]] = sz;
lz[rc[id]] = 1;
f[rc[id]] = sz;
lz[id] = 0;
}
void update(int u, int v, int id = 0, int l = 1, int r = 1 << 30)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |