# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102863 | wxh010910 | Art Class (IOI13_artclass) | C++17 | 327 ms | 3448 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 ave = 0, var = 0;
for (int i = 0; i < H; ++i) {
for (int j = 0; j < W; ++j) {
int foo = 0, bar = 0, baz = 0;
for (int x = i - 5; x <= i + 5; ++x) {
for (int y = j - 5; y <= j + 5; ++y) {
if (x >= 0 && x < H && y >= 0 && y < W) {
foo += abs(R[x][y] - R[i][j]) + abs(G[x][y] - G[i][j]) + abs(B[x][y] - B[i][j]);
bar += (R[x][y] - R[i][j]) * (R[x][y] - R[i][j]) + (G[x][y] - R[i][j]) * (G[x][y] - G[i][j]) + (B[x][y] - R[i][j]) * (B[x][y] - B[i][j]);
baz += 1;
}
}
}
ave += (double) foo / baz;
var += (double) bar / baz;
}
}
ave /= 3 * H * W;
var /= 3 * H * W;
if (ave < 6) {
return 4;
} else if (ave > 30) {
return 3;
} else if (var > 1000) {
return 1;
} else {
return 2;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |