# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800423 | fve5 | Dynamic Diameter (CEOI19_diameter) | C++17 | 3152 ms | 166144 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;
constexpr int64_t INF = 2e18;
class SegTree {
int size;
vector<int64_t> arr, lazy;
void update(int n, int nb, int ne) {
if (lazy[n]) {
arr[n] += lazy[n];
if (nb + 1 != ne) {
lazy[2 * n] += lazy[n];
lazy[2 * n + 1] += lazy[n];
}
lazy[n] = 0;
}
}
void add(int l, int r, int64_t d, int n, int nb, int ne) {
update(n, nb, ne);
if (nb >= r || ne <= l) return;
if (l <= nb && ne <= r) {
lazy[n] = d;
update(n, nb, ne);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |