# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
879765 | Desh03 | Sterilizing Spray (JOI15_sterilizing) | C++17 | 122 ms | 3408 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;
struct SegmentTree {
vector<long long> T;
int n;
SegmentTree(const vector<int> &v) : n(v.size()) {
while (n & n - 1) ++n;
T.resize(n << 1);
for (int i = 0; i < v.size(); i++) {
T[i + n] = v[i];
}
for (int i = n - 1; i > 0; i--) {
T[i] = T[i << 1] + T[i << 1 | 1];
}
}
void upd0(int v, int l, int r, int u, int x) {
if (l == r) {
T[v] = x;
return;
}
int m = l + r >> 1;
if (u <= m) upd0(v << 1, l, m, u, x);
else upd0(v << 1 | 1, m + 1, r, u, x);
T[v] = T[v << 1] + T[v << 1 | 1];
}
void upd1(int v, int l, int r, int ql, int qr, const int &x) {
if (l > qr || r < ql || !T[v]) return;
if (l == r) {
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... |