# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57399 | fredbr | Art Class (IOI13_artclass) | C++17 | 136 ms | 3624 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;
const int maxn = 500;
int style(int h, int w, int r[maxn][maxn], int g[maxn][maxn], int b[maxn][maxn])
{
double ans = 0;
for (int i = 1; i < h-1; i++) {
for (int j = 1; j < w-1; j++) {
ans += abs(r[i][j]-r[i-1][j]);
ans += abs(g[i][j]-g[i-1][j]);
ans += abs(b[i][j]-b[i-1][j]);
ans += abs(r[i][j]-r[i+1][j]);
ans += abs(g[i][j]-g[i+1][j]);
ans += abs(b[i][j]-b[i+1][j]);
ans += abs(r[i][j]-r[i][j-1]);
ans += abs(g[i][j]-g[i][j-1]);
ans += abs(b[i][j]-b[i][j-1]);
ans += abs(r[i][j]-r[i][j+1]);
ans += abs(g[i][j]-g[i][j+1]);
ans += abs(b[i][j]-b[i][j+1]);
}
}
ans /= (h*w);
int style = 0;
if (ans >= 40 and ans <= 105) style = 1;
else if (ans >= 105 and ans <= 220) style = 2;
else if (ans >= 220) style = 3;
else style = 4;
return style;
// return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |