#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
template<class T> class fenwick_tree {
private:
int n;
vector<long long> ft;
public:
fenwick_tree(int N) : n(N), ft(N + 1, 0) {}
void update(int a, int b){
while(a <= n){
ft[a] += b;
a += a & -a;
}
}
T get_val(int ind){
T res = 0;
while(ind > 0){
res += ft[ind];
ind -= ind & -ind;
}
return res;
}
};
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
for(int i = 0; i < k; i++){
for(int j = left[i]; j <= right[i]; j++){
if(op[i] == 1){
if(finalHeight[j] > height[i]) continue;
finalHeight[j] = height[i];
continue;
}
if(finalHeight[j] < height[i]) continue;
finalHeight[j] = height[i];
}
}
return;
}
# | 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... |