제출 #363945

#제출 시각아이디문제언어결과실행 시간메모리
363945NachoLibre미술 수업 (IOI13_artclass)C++17
16 / 100
84 ms6252 KiB
#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 timeMemoryGrader output
Fetching results...