# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066105 | sammyuri | Foehn Phenomena (JOI17_foehn_phenomena) | C++17 | 692 ms | 18260 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;
typedef long long ll;
const int MAXN = (1 << 18);
ll tree[2 * MAXN], lazy[2 * MAXN];
void init() {
for (int i = 0; i < 2 * MAXN; i ++)
tree[i] = lazy[i] = 0;
}
void pushdown(int index) {
if (lazy[index] != 0) {
if (index < MAXN) {
lazy[2 * index] += lazy[index];
lazy[2 * index + 1] += lazy[index];
tree[index] = tree[2 * index] + tree[2 * index + 1] + lazy[index];
} else {
tree[index] += lazy[index];
}
lazy[index] = 0;
}
}
void upd(int left, int right, int index, int maxl, int maxr, ll value) {
if (left == maxl && right == maxr) {
lazy[index] += value; return;
}
pushdown(index);
int mid = (maxl + maxr) / 2;
if (left <= mid)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |