Submission #969252

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9692522024-04-24 19:47:28duckindogTriple Jump (JOI19_jumps)C++17
100 / 100
721 ms62272 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 500'000 + 10;
int n;
int a[N];
int q;
vector<pair<int, int>> Q[N];
int f[N << 2], T[N << 2], lazy[N << 2];
void build(int s, int l, int r) {
if (l == r) {
T[s] = f[s] = a[l];
return;
}
int mid = l + r >> 1;
build(s << 1, l, mid); build(s << 1 | 1, mid + 1, r);
T[s] = max(T[s << 1], T[s << 1 | 1]);
f[s] = max(f[s << 1], f[s << 1 | 1]);
}
void push(int s) {
f[s << 1] = max(f[s << 1], T[s << 1] + lazy[s]);
f[s << 1 | 1] = max(f[s << 1 | 1], T[s << 1 | 1] + lazy[s]);
lazy[s << 1] = max(lazy[s << 1], lazy[s]);
lazy[s << 1 | 1] = max(lazy[s << 1 | 1], lazy[s]);
}
void update(int s, int l, int r, int u, int v, int x) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jumps.cpp: In function 'void build(int, int, int)':
jumps.cpp:17:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |   int mid = l + r >> 1;
      |             ~~^~~
jumps.cpp: In function 'void update(int, int, int, int, int, int)':
jumps.cpp:38:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   38 |   int mid = l + r >> 1;
      |             ~~^~~
jumps.cpp: In function 'int query(int, int, int, int, int)':
jumps.cpp:46:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   46 |   int mid = l + r >> 1;
      |             ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...