# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
885497 | gustavo_d | Art Class (IOI13_artclass) | C++17 | 62 ms | 6484 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;
typedef long long ll;
struct Pixel {
int r, g, b;
Pixel() {
r=-1, g=-1; b=-1;
}
Pixel(int red, int green, int blue) {
r = red; g = green; b = blue;
}
};
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
Pixel img[H][W];
for (int i=0; i<H; i++) {
for (int j=0; j<W; j++) {
img[i][j] = Pixel(R[i][j], G[i][j], B[i][j]);
}
}
ll total_dist = 0;
for (int i=1; i<H-1; i++) {
for (int j=1; j<W-1; j++) {
vector<int> dif(3);
dif = {-1, 0, 1};
for (int di : dif) {
for (int dj : dif) {
total_dist += abs(img[i][j].r - img[i+di][j+dj].r);
total_dist += abs(img[i][j].g - img[i+di][j+dj].g);
total_dist += abs(img[i][j].b - img[i+di][j+dj].b);
}
}
}
}
//cout << total_dist/((ll)H*(ll)W) << endl;
if (total_dist/((ll)H * (ll)W) >= 400) return 3; // dividir pelo tamanho da imagem
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |