# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
970994 | vladilius | The short shank; Redemption (BOI21_prison) | C++17 | 2066 ms | 75720 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;
using ll = long long;
const int inf = numeric_limits<int> :: max();
struct ST{
vector<int> t, p;
int n;
ST(int ns){
n = ns;
t.resize(4 * n);
p.resize(4 * n);
}
void push(int& v, int& vv){
if (!p[v]) return;
p[vv] += p[v]; t[vv] += p[v];
p[vv + 1] += p[v]; t[vv + 1] += p[v];
p[v] = 0;
}
void add(int v, int tl, int tr, int& l, int& r, int& x){
if (l > tr || r < tl) return;
if (l <= tl && tr <= r){
t[v] += x;
p[v] += x;
return;
}
int tm = (tl + tr) / 2, vv = 2 * v;
push(v, vv);
add(vv, tl, tm, l, r, x);
add(vv + 1, tm + 1, tr, l, r, x);
# | 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... |