# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
996873 | pera | Two Antennas (JOI19_antennas) | C++17 | 1 ms | 348 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;
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]};
# | 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... |