# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475447 | keta_tsimakuridze | Addk (eJOI21_addk) | C++14 | 684 ms | 9412 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>
#define f first
#define s second
#define int long long
#define pii pair<int,int>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7; // !
int t, n, q, a[N], tree[4 * N],lazy[4*N],b[20];
void push(int u,int l,int r) {
tree[u] += lazy[u] * (r - l + 1);
if(l != r) {
lazy[2 * u] += lazy[u];
lazy[2 * u + 1] += lazy[u];
}
lazy[u] = 0;
}
void upd(int u,int start,int end,int l,int r,int val) {
push(u,l,r);
if(l > end || r < start) return;
if(start <= l && r <= end) {
lazy[u] = val;
push(u,l,r);
return;
}
int mid = (l + r)/2;
upd(2 * u, start, end, l, mid, val);
upd(2 * u + 1, start, end, mid + 1, r, val);
tree[u] = tree[2 * u] + tree[2 * u + 1];
}
int get(int u,int start,int end,int l,int 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... |