제출 #679427

#제출 시각아이디문제언어결과실행 시간메모리
679427kilikuma벽 (IOI14_wall)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include <wall.h>
using namespace std;
void buildWall(int N, int K, int operations[], int gauche[], int droite[], int hauteur[], int hauteurFinale[]) {
  for (int i = 0; i < N; i ++)
    hauteurFinale[i] = 0;
  for (int iOperation = 0; iOperation < K; iOperation ++) {
    if (operation[iOperation] == 1) {
      for (int indice = gauche[iOperation]; indice <= droite[iOperation]; indice ++) {
        if (hauteurFinale[indice] <= hauteur[iOperation])
          hauteurFinale[indice] = hauteur[iOperation];

      }
    }
    else {
      for (int indice = gauche[iOperation]; indice <= droite[iOperation]; indice ++) {
        if (hauteurFinale[indice] >= hauteur[iOperation])
          hauteurFinale[indice] = hauteur[iOperation];

      }
    }
  }
}

컴파일 시 표준 에러 (stderr) 메시지

wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:8:9: error: 'operation' was not declared in this scope; did you mean 'operations'?
    8 |     if (operation[iOperation] == 1) {
      |         ^~~~~~~~~
      |         operations