| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 311783 | MilosMilutinovic | Wall (IOI14_wall) | C++14 | 0 ms | 0 KiB |
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;
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]) {
finalHeight[j] = height[i];
}
} else {
if (finalHeight[j] > height[i]) {
finalHeight[j] = height[i];
}
}
}
}
}
/*int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, qq;
cin >> n >> qq;
vector<int> op(qq), l(qq), r(qq), h(qq);
vector<int> ans(n, 0);
for (int i = 0; i < qq; i++) {
cin >> op[i] >> l[i] >> r[i] >> h[i];
}
buildwall(n, qq, op, l, r, h, ans);
for (int i = 0; i < n; i++) {
cout << ans[i] << " ";
}
return 0;
}*/
/*
10 6
1 1 8 4
2 4 9 1
2 3 6 5
1 0 5 3
1 2 2 5
2 6 7 0
*/
