# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102862 | wxh010910 | Art Class (IOI13_artclass) | C++17 | 114 ms | 6140 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>
#include "artclass.h"
using namespace std;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
double diff = 0;
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
int sumR = 0, sumG = 0, sumB = 0, cnt = 0;
for (int x = i - 1; x <= i + 1; ++x) {
for (int y = j - 1; y <= j + 1; ++y) {
if (x >= 0 && x < H && y >= 0 && y < W) {
sumR += R[x][y];
sumG += G[x][y];
sumB += B[x][y];
++cnt;
}
}
}
double diffR = fabs(R[i][j] - (double) sumR / cnt);
double diffG = fabs(G[i][j] - (double) sumG / cnt);
double diffB = fabs(B[i][j] - (double) sumB / cnt);
diff += diffR + diffG + diffB;
}
}
diff /= 3 * H * W;
if (diff >= 10) {
return 3;
} else if (diff < 1.8) {
return 4;
} else {
return 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |