Submission #595047

# Submission time Handle Problem Language Result Execution time Memory
595047 2022-07-13T09:48:48 Z pakhomovee Art Class (IOI13_artclass) C++17
Compilation error
0 ms 0 KB
#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

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])) {
      |                           ^~~