# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
801877 | LittleCube | Art Class (IOI13_artclass) | C++17 | 69 ms | 3540 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;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
double avgR = 0, avgG = 0, avgB = 0;
double diff = 0;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
avgR += R[i][j], avgG += G[i][j], avgB += B[i][j];
for (int i = 3; i + 3 < H; i++)
for (int j = 3; j + 3 < W; j++)
for (int x = i - 3; x <= i + 3; x++)
for (int y = j - 3; y <= j + 3; y++)
diff += (R[i][j] - R[x][y]) * (R[i][j] - R[x][y]) +
(G[i][j] - G[x][y]) * (G[i][j] - G[x][y]) +
(B[i][j] - B[x][y]) * (B[i][j] - B[x][y]);
avgR /= H * W, avgG /= H * W, avgB /= H * W;
diff /= H * W;
// cerr << avgR + avgG + avgB << ' ' << diff << '\n';
if(diff <= 30000.0)
return 4;
if (diff <= 100000.0)
return 2;
if(diff <= 300000.0)
return 1;
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |