# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
379885 | WLZ | Art Class (IOI13_artclass) | C++14 | 75 ms | 6124 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 vector<int> dx = {1, -1, 0, 0};
const vector<int> dy = {0, 0, 1, -1};
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
double val = 0.0;
int cnt = 0;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
for (int k = 0; k < 4; k++) {
int ni = i + dx[k], nj = j + dy[k];
if (ni < 0 || nj < 0 || ni >= H || nj < 0) continue;
val += abs(R[i][j] - R[ni][nj]) + abs(G[i][j] - G[ni][nj]) + abs(G[i][j] - G[ni][nj]);
cnt += 3;
}
}
}
if (val / cnt < 3.0) return 4;
if (val / cnt < 6.0) return 1;
if (val / cnt < 15.0) return 2;
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |