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 "wall.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fore(a, b, c) for(int a=b; a<c; ++a)
#define vi vector<int>
#define pb push_back
#define ii pair<int,int>
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define dbg(x) cerr << #x << ": " << x << endl
#define raya cerr << "===============" << endl
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
fore(i, 0, k){
if(op[i] == 1){
// adding
fore(j, left[i], right[i]+1){
finalHeight[j] = max(height[i], finalHeight[j]);
}
}
else {
// removing
fore(j, left[i], right[i]+1){
finalHeight[j] = min(height[i], finalHeight[j]);
}
}
}
}
# | 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... |