# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
332206 | vitkishloh228 | Simple game (IZhO17_game) | C++14 | 561 ms | 19584 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<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int N = 1000004;
int t[4 * N], mod[4 * N];
void push(int v, int l, int r) {
if (l == r) {
mod[v] = 0;
return;
}
mod[2 * v] += mod[v];
mod[2 * v + 1] += mod[v];
t[2 * v] += mod[v];
t[2 * v + 1] += mod[v];
mod[v] = 0;
return;
}
void upd(int v, int tl, int tr, int l, int r, int x) {
push(v, tl, tr);
if (tl > tr || l > r) return;
if (tl == l && tr == r) {
mod[v] += x;
t[v] += x;
return;
}
int tm = (tl + tr) >> 1;
upd(2 * v, tl, tm, l, min(r, tm), x);
upd(2 * v + 1, tm + 1, tr, max(l, tm + 1), 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... |