# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969229 | anango | Art Class (IOI13_artclass) | C++14 | 51 ms | 4432 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;
bool bounds(int x, int y) {
return (0<=x && x<500 && 0<=y && y<500);
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
double bl=0;
int T[500][500];
vector<int> dx={0,0,-1,1};
vector<int> dy={1,-1,0,0};
for (int i=0; i<500; i++) {
for (int j=0; j<500; j++) {
T[i][j] = (R[i][j]+G[i][j]+B[i][j])/3;
}
}
for (int i=0; i<500; i++) {
for (int j=0; j<500; j++) {
for (int d=0; d<4; d++) {
int nx=i+dx[d];
int ny=j+dy[d];
if (!bounds(nx,ny)) {
continue;
}
bl+=abs(T[nx][ny]-T[i][j]);
}
}
}
bl = bl/500/500;
//cout << bl << endl;
if (bl<11) {
return 4;
}
if (bl<29) {
return 1;
}
if (bl<50) {
return 2;
}
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |