Submission #290255

#TimeUsernameProblemLanguageResultExecution timeMemory
290255AaronNaiduWall (IOI14_wall)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.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 < n; i++) { finalHeight[i] = 0; } for (int i = 0; i < k; i++) { if (op == 1) { for (int j = left[i]; j < right[i]; j++) { finalHeight[j] = max(finalHeight[j], heights[i]); } } else { for (int j = left[i]; j < right[i]; j++) { finalHeight[j] = min(finalHeight[j], heights[i]); } } } }

Compilation message (stderr)

wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if (op == 1)
      |                   ^
wall.cpp:16:54: error: 'heights' was not declared in this scope; did you mean 'height'?
   16 |                 finalHeight[j] = max(finalHeight[j], heights[i]);
      |                                                      ^~~~~~~
      |                                                      height
wall.cpp:23:54: error: 'heights' was not declared in this scope; did you mean 'height'?
   23 |                 finalHeight[j] = min(finalHeight[j], heights[i]);
      |                                                      ^~~~~~~
      |                                                      height