# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157965 | NachoLibre | Art Class (IOI13_artclass) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
//using namespace std;
#include "artclass.h"
const int Bk = 25, WK = 200;
bool iswh(int r, int g, int b) {
if(min(r, min(g, b)) >= WK) return 1;
return 0;
}
bool isbl(int r, int g, int b) {
if(r + g + b <= BK) return 1;
return 0;
}
bool isgr(int r, int g, int b) {
if(g >= (r + b) * 2) return 1;
return 0;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int w = 0, b = 0, g = 0;
for(int i = 0; i < H; ++i) {
for(int j = 0; j < W; ++j) {
if(iswh(R[i][j], G[i][j], B[i][j])) ++w;
if(isbl(R[i][j], G[i][j], B[i][j])) ++b;
if(isgr(R[i][j], G[i][j], B[i][j])) ++g;
}
}
if(w * 3 >= H * W && b * 15 >= H * W) return 1;
if(g * 3 >= H * W) return 2;
if(b * 10 >= H * W) return 3;
return 4;
}