# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1035598 | May27_th | Financial Report (JOI21_financial) | C++17 | 337 ms | 59560 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;
#define i64 long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
int N, D;
struct Tree{
int n;
vector<int64_t>lazy;
vector<int64_t>st;
Tree(int _n, int64_t _v): n(_n), st(_n * 4, _v), lazy(_n * 4, _v){};
void push(int id){
int64_t add = lazy[id];
lazy[id * 2] += add, st[id * 2] += add;
lazy[id * 2 + 1] += add, st[id * 2 + 1] += add;
lazy[id] = 0;
}
void update(int id, int l, int r, int u, int v, int64_t val){
if (v < l || u > r) return;
if (u <= l && r <= v) {
st[id] = val;
lazy[id] = val;
return;
}
// push(id);
int mid = (l + r)/2;
update(id * 2, l, mid, u, v, val);
update(id * 2 + 1, mid + 1, r, u, v, val);
st[id] = max(st[id * 2], st[id * 2 + 1]);
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... |