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>
#include "wall.h"
#define ll long long
using namespace std;
const int maxn=2e6+5;
int N,Q;
vector<pair<int,int>> sta[maxn];
int resavaj(vector<pair<int,int>> V){
int h=0;
for(auto x:V){
if(x.first==1)
h=max(h,x.second);
else
h=min(h,x.second);
}
return h;
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
N=n;
Q=k;
for(int i=0;i<Q;i++){
for(int j=left[i];j<=right[i];j++)
sta[j].push_back({op[i],height[i]});
}
for(int i=0;i<N;i++)
finalHeight[i]=resavaj(sta[i]);
}
# | 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... |