# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
763346 | SanguineChameleon | Art Class (IOI13_artclass) | C++17 | 54 ms | 6036 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 N, int M, int R[500][500], int G[500][500], int B[500][500]) {
int sum = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M - 1; j++) {
sum += abs(R[i][j] - R[i][j + 1]);
sum += abs(G[i][j] - G[i][j + 1]);
sum += abs(B[i][j] - B[i][j + 1]);
}
}
for (int i = 0; i < N - 1; i++) {
for (int j = 0; j < M; j++) {
sum += abs(R[i][j] - R[i + 1][j]);
sum += abs(G[i][j] - G[i + 1][j]);
sum += abs(B[i][j] - B[i + 1][j]);
}
}
long double avg = 1.0L * sum / ((N * (M - 1) + (N - 1) * M) * 3);
if (avg <= 2.5L) {
return 4;
}
else if (avg <= 9.5L) {
return 1;
}
else if (avg <= 19.5L) {
return 2;
}
else {
return 3;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |