# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250973 | A02 | Art Class (IOI13_artclass) | C++14 | 110 ms | 8300 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 <iostream>
#include <vector>
#include <math.h>
#include <stdlib.h>
using namespace std;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
vector<long long> differences;
for (int i = 2; i < H - 2; i++){
for (int j = 2; j < W - 2; j++){
long long difference = 0;
for (int dx = -2; dx <= 2; dx++){
for (int dy = -2; dy <= 2; dy++){
difference += abs(R[i + dx][j + dy] - R[i][j]);
difference += abs(B[i + dx][j + dy] - B[i][j]);
difference += abs(G[i + dx][j + dy] - G[i][j]);
}
}
differences.push_back(difference);
}
}
long long total = 0;
for (int i = 0; i < differences.size(); i++){
total += differences[i] * differences[i];
}
double avgd = sqrt(((double) total) / ((double)((H-2) * (W-2))));
cout << avgd;
if (avgd < 700){
return 4;
}
if (avgd > 2000){
return 3;
}
long long intensity = 0;
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
intensity += (R[i][j] + G[i][j] + B[i][j]) * ((R[i][j] + G[i][j] + B[i][j]));
}
}
double ag = sqrt(intensity / (H * W));
if (intensity > 400){
return 1;
}
return 2;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |