Submission #478238

#TimeUsernameProblemLanguageResultExecution timeMemory
478238PiejanVDCWall (IOI14_wall)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void buildWall(int n, int k, vector<int>op, vector<int>left, vector<int>right, vector<int>height, vector<int>finalHeight) { finalHeight.assign(n,0); for(int i = 0 j; i < k ; i++) { if(op[i] == 1) { for(int p = left[i] ; p <= right[i] ; p++) { finalHeight[p] = max(height[i],finalHeight[p]); } } else { for(int p = left[i] ; p <= right[i] ; p++) { finalHeight[p] = min(height[i],finalHeight[p]); } } } }

Compilation message (stderr)

wall.cpp: In function 'void buildWall(int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
wall.cpp:6:18: error: expected ';' before 'j'
    6 |     for(int i = 0 j; i < k ; i++) {
      |                  ^~
      |                  ;
wall.cpp:6:19: error: 'j' was not declared in this scope
    6 |     for(int i = 0 j; i < k ; i++) {
      |                   ^
wall.cpp:6:24: warning: for increment expression has no effect [-Wunused-value]
    6 |     for(int i = 0 j; i < k ; i++) {
      |                      ~~^~~
wall.cpp:6:27: error: expected ')' before ';' token
    6 |     for(int i = 0 j; i < k ; i++) {
      |        ~                  ^~
      |                           )
wall.cpp:6:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    6 |     for(int i = 0 j; i < k ; i++) {
      |     ^~~
wall.cpp:6:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    6 |     for(int i = 0 j; i < k ; i++) {
      |                              ^
wall.cpp:6:30: error: 'i' was not declared in this scope