Submission #337095

#TimeUsernameProblemLanguageResultExecution timeMemory
337095blueWall (IOI14_wall)C++11
Compilation error
0 ms0 KiB
#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 < n; i++) finalHeight[i] = 0; for(int q = 0; q < k; q++) { if(op[q] == 1) { for(int i = l[q]; i <= r[q]) finalHeight[i] = max(finalHeight[i], height[q]); } else { for(int i = l[q]; i <= r[q]) finalHeight[i] = min(finalHeight[i], height[q]); } } }

Compilation message (stderr)

wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:12:25: error: 'l' was not declared in this scope
   12 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = max(finalHeight[i], height[q]);
      |                         ^
wall.cpp:12:36: error: 'r' was not declared in this scope
   12 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = max(finalHeight[i], height[q]);
      |                                    ^
wall.cpp:12:40: error: expected ';' before ')' token
   12 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = max(finalHeight[i], height[q]);
      |                                        ^
      |                                        ;
wall.cpp:12:59: error: 'max' was not declared in this scope
   12 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = max(finalHeight[i], height[q]);
      |                                                           ^~~
wall.cpp:16:25: error: 'l' was not declared in this scope
   16 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = min(finalHeight[i], height[q]);
      |                         ^
wall.cpp:16:36: error: 'r' was not declared in this scope
   16 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = min(finalHeight[i], height[q]);
      |                                    ^
wall.cpp:16:40: error: expected ';' before ')' token
   16 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = min(finalHeight[i], height[q]);
      |                                        ^
      |                                        ;
wall.cpp:16:59: error: 'min' was not declared in this scope
   16 |             for(int i = l[q]; i <= r[q]) finalHeight[i] = min(finalHeight[i], height[q]);
      |                                                           ^~~