제출 #351238

#제출 시각아이디문제언어결과실행 시간메모리
351238Mefarnis미술 수업 (IOI13_artclass)C++14
컴파일 에러
0 ms0 KiB
#include "artclass.h" const double GREEN_RATIO = 0.4; const int GREEN_LOW_GREEN = 100; const int GREEN_GREEN_RED_DIFF = 50; const int GREEN_GREEN_BLUE_DIFF = 50; int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]) { int ans; int gcnt = 0; for( int i = 0 ; i < n ; i++ ) for( int j = 0 ; j < m ; j++ ) if(g[i] >= GREEN_LOW_GREEN && g[i]-b[i] >= GREEN_GREEN_BLUE_DIFF && g[i]-R[i] >= GREEN_GREEN_RED_DIFF) gcnt++; if(gcnt >= n*m*GREEN_RATIO) ans = 2; else ans = 1; return ans; }

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

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |    if(g[i] >= GREEN_LOW_GREEN && g[i]-b[i] >= GREEN_GREEN_BLUE_DIFF && g[i]-R[i] >= GREEN_GREEN_RED_DIFF)
      |               ^~~~~~~~~~~~~~~
artclass.cpp:13:77: error: 'R' was not declared in this scope
   13 |    if(g[i] >= GREEN_LOW_GREEN && g[i]-b[i] >= GREEN_GREEN_BLUE_DIFF && g[i]-R[i] >= GREEN_GREEN_RED_DIFF)
      |                                                                             ^