# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
363945 | NachoLibre | Art Class (IOI13_artclass) | C++17 | 84 ms | 6252 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 = 150, WK = 200;
bool iswh(int r, int g, int b) {
if(min(r, min(g, b)) >= WK && max(r, max(b, g)) - min(r, min(g, b)) <= 30) 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 >= max(r, b) * 1.5) return 1;
return 0;
}
bool isgra(int r, int g, int b) {
if(r + g + b <= 540 && max(r, max(b, g)) - min(r, min(g, b)) <= 15) 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, gr = 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(isgra(R[i][j], G[i][j], B[i][j])) ++gr;
}
}
if(w * 5 >= H * W) return 1;
if(g * 4 >= H * W) return 2;
if(b * 15 >= H * W && gr * 7 >= H * W) return 3;
return 4;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |