Submission #739101

# Submission time Handle Problem Language Result Execution time Memory
739101 2023-05-09T23:58:41 Z grossly_overconfident 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 one = 0, two = 0, three = 0, four = 0;

    for (int i = 0; i < h; ++i){
        for (int j = 0; j < w; ++j){
            if (g[i][j] > r[i][j] + 100 && g[i][j] > b[i][j] + 100){
                two += 1;
            }
            if (r[i][j] > 225 && g[i][j] > 225 && b[i][j] > 225){
                one += 1;
            }
            if (r[i][j] > g[i][j] + 200 && r[i][j] > b[i][j] + 200){
                four += 1;
            }
            if (b[i][j] > g[i][j] + 200 && b[i][j] > r[i][j] + 200){
                four += 1;
            }
        }
    }
    if (max(max(one, two), four) < w * h / 2){
        return 3;
    }
    if (two > one && two > four){
        return 2;
    }
    if (four > one && four > two){
        return 4;
    }
    

    return 1;
}

Compilation message

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:22:13: error: 'max' was not declared in this scope
   22 |     if (max(max(one, two), four) < w * h / 2){
      |             ^~~
artclass.cpp:22:9: error: 'max' was not declared in this scope
   22 |     if (max(max(one, two), four) < w * h / 2){
      |         ^~~
artclass.cpp:4:27: warning: unused variable 'three' [-Wunused-variable]
    4 |     int one = 0, two = 0, three = 0, four = 0;
      |                           ^~~~~