Submission #521510

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5215102022-02-02 09:47:33amunduzbaevFood Court (JOI21_foodcourt)C++14
0 / 100
658 ms89352 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...