Submission #351242

#TimeUsernameProblemLanguageResultExecution timeMemory
351242MefarnisArt Class (IOI13_artclass)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; 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; }

Compilation message (stderr)

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