# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
575787 | Mazaalai | Art Class (IOI13_artclass) | C++17 | 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 "artclass.h"
ll r, g, b;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
for (int i = 0; i < 500; i++)
for (int j = 0; j < 500; j++) {
r += R[i][j];
g += G[i][j];
b += B[i][j];
}
if (r > 1.5 * (g + b)) return 2;
map <VI, int> cnts;
int maxi = 0;
for (int j = 0; j < 500; j++) {
ll rr, gg, bb; rr = gg = bb = 0;
for (int i = 0; i < 500; i++) {
rr += R[i][j];
gg += G[i][j];
bb += B[i][j];
}
rr /= 5000;
gg /= 5000;
bb /= 5000;
maxi = max(maxi, ++cnts[{rr, gg, bb}]);
}
if (maxi > 400) return 4;
r /= 500 * 500 * 10;
g /= 500 * 500 * 10;
b /= 500 * 500 * 10;
if (r == g && g == b) return 3;
return 1;
}