# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963157 | biank | Weighting stones (IZhO11_stones) | C++14 | 48 ms | 4340 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;
const int SZ = 1 << 17;
struct Node {
int mini = 0, maxi = 0;
};
Node st[2 * SZ];
int lazy[2 * SZ];
inline Node op(const Node &a, const Node &b) {
return {min(a.mini, b.mini), max(a.maxi, b.maxi)};
}
void pass(int u) {
if (u < SZ) {
lazy[2 * u] += lazy[u];
lazy[2 * u + 1] += lazy[u];
}
st[u].mini += lazy[u];
st[u].maxi += lazy[u];
lazy[u] = 0;
}
void update(int s, int e, int v, int l = 0, int r = SZ, int u = 1) {
pass(u);
if (e <= l || r <= s) return;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |