Submission #542979

#TimeUsernameProblemLanguageResultExecution timeMemory
542979nayhzArt Class (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include "artclass.h" int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { int total = H * (W - 1); for (int i = 0; i < H; i++) { for (int j = 0; j < W - 1; j++) { one++; change += abs(R[i][j] - R[i][j + 1]); change += abs(G[i][j] - G[i][j + 1]); change += abs(B[i][j] - B[i][j + 1]); } } change /= total; if (change <= 10) return 4; else if (change <= 20) return 1; else if (change >= 150) return 2; else return 3; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:8:13: error: 'one' was not declared in this scope
    8 |             one++;
      |             ^~~
artclass.cpp:9:13: error: 'change' was not declared in this scope
    9 |             change += abs(R[i][j] - R[i][j + 1]);
      |             ^~~~~~
artclass.cpp:9:23: error: 'abs' was not declared in this scope
    9 |             change += abs(R[i][j] - R[i][j + 1]);
      |                       ^~~
artclass.cpp:14:5: error: 'change' was not declared in this scope
   14 |     change /= total;
      |     ^~~~~~
artclass.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^