# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
575791 | Mazaalai | Art Class (IOI13_artclass) | C++17 | 50 ms | 3556 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"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector <ll>;
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;
++cnts[{rr, gg, bb}];
maxi = max(maxi, cnts[{rr, gg, bb}]);
}
if (maxi > 400) return 4;
r /= 500 * 500 * 50;
g /= 500 * 500 * 50;
b /= 500 * 500 * 50;
if (r == g && g == b) return 3;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |