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 mxN = (int)2e6+10;
const int INF = (int)1e9;
int n, A[mxN], B[mxN];
void buildWall(int N, int k, int o[], int l[], int r[], int h[], int ans[]){
n = N;
for(int i = 0; i < n; i++) A[i]=INF,B[i]=-INF;
for(int i = 0; i < k; i++){
int a, b;
if(o[i]==1) a = INF, b = h[i];
else a = h[i], b = -INF;
for(int j = l[i]; j <= r[i]; j++){
A[j] = min(a, max(A[j],b));
B[j] = max(B[j],b);
}
}
for(int i = 0; i < n; i++) ans[i] = min(A[i],max(ans[i],B[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... |