Submission #595047

#TimeUsernameProblemLanguageResultExecution timeMemory
595047pakhomoveeArt 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 countGreen = 0;
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            if (G[i][j] > max(R[i][h], B[i][j])) {
                ++countGreen;
            }
        }
    }
    if (countGreen >= 0.75 * H * W) {
        return 2;
    }
    return 1;
}

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:7:36: error: 'h' was not declared in this scope
    7 |             if (G[i][j] > max(R[i][h], B[i][j])) {
      |                                    ^
artclass.cpp:7:27: error: 'max' was not declared in this scope
    7 |             if (G[i][j] > max(R[i][h], B[i][j])) {
      |                           ^~~