Submission #996873

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9968732024-06-11 11:24:18peraTwo Antennas (JOI19_antennas)C++17
0 / 100
1 ms348 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 10 + 10;
int n , q;
vector<int> L(N) , R(N) , A(N) , B(N) , H(N) , ANS(N) , ans(N) , value(4 * N , -1) ;
vector<vector<int>> queries(N) , turn_on(N) , turn_off(N);
struct node{
int mn = 1e9 + 1 , mx = 0;
};
vector<node> t(4 * N) , lz(4 * N);
node MERGE(node x , node y){
node z;
z.mn = min(x.mn , y.mn);
z.mx = max(x.mx , y.mx);
return z;
}
void upd_ans(int u){
ANS[u] = max({ANS[u] , lz[u].mx - t[u].mn , t[u].mx - lz[u].mn});
}
void combine(int u){
lz[u] = MERGE(lz[u * 2] , lz[u * 2 + 1]);
t[u] = MERGE(t[u * 2] , t[u * 2 + 1]);
ANS[u] = max({ANS[u] , ANS[u * 2] , ANS[u * 2 + 1]});
}
void push(int u){
if(value[u] == -1){
return;
}
value[u * 2] = value[u * 2 + 1] = value[u];
lz[u * 2] = {value[u] ,value[u]};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...