Submission #363963

#TimeUsernameProblemLanguageResultExecution timeMemory
363963NachoLibreArt Class (IOI13_artclass)C++17
6 / 100
74 ms3948 KiB
#include <bits/stdc++.h> using namespace std; #include "artclass.h" const int BK = 200, 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 >= 350 && r + g + b <= 600 && 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...