Submission #311784

#TimeUsernameProblemLanguageResultExecution timeMemory
311784MilosMilutinovicWall (IOI14_wall)C++14
8 / 100
3080 ms18296 KiB
#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
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...