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"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
#define FOR(i, j, k) for(ll i = (ll) (j); (i) < (ll) (k); ++(i))
#define FORD(i, j, k) for(ll i = (ll) (j); (i) >= (ll) (k); --(i))
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
#define nl "\n"
#define sp " "
#define fr first
#define sc second
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
// adding phase:
// set all values in this range to max(val, currentval)
// removing phase :
// set all values in this range to min(val, currentval)
FOR(i, 0, k) {
if(op[i] == 1) {
FOR(j, left[i], right[i] + 1) {
finalHeight[j] = max(finalHeight[j], height[i]);
}
} else {
FOR(j, left[i], right[i] + 1) {
finalHeight[j] = min(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... |