# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521510 | amunduzbaev | Food Court (JOI21_foodcourt) | C++14 | 658 ms | 89352 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 ar array
#define int long long
const int N = 3e5 + 5;
struct node{
int t, l, r, c, k, a, b;
};
struct BIT{
int tree[N<<2], p[2][N<<2];
void push(int x, int lx, int rx){
if(lx == rx) return;
tree[x<<1] += p[0][x], tree[x<<1|1] += p[0][x];
p[0][x<<1] += p[0][x], p[0][x<<1|1] += p[0][x];
p[1][x<<1] += p[0][x], p[1][x<<1|1] += p[0][x];
tree[x<<1] = max(tree[x<<1], p[1][x]);
p[1][x<<1] = max(p[1][x<<1], p[1][x]);
tree[x<<1|1] = max(tree[x<<1|1], p[1][x]);
p[1][x<<1|1] = max(p[1][x<<1|1], p[1][x]);
p[0][x] = 0, p[1][x] = -1e18;
}
void add(int l, int r, int v, int lx = 0, int rx = N, int x = 1){
if(lx > r || rx < l) return;
if(lx >= l && rx <= r){
tree[x] += v;
p[0][x] += v, p[1][x] += v;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |