# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
7515 | baneling100 | Art Class (IOI13_artclass) | C++98 | 128 ms | 3696 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 <stdlib.h>
#include <stdio.h>
double Red, Green, Blue, Color;
int Dy[4]={0,1,0,-1}, Dx[4]={1,0,-1,0};
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
int i, j, k, y, x;
Red=Green=Blue=0;
for(i=0 ; i<H ; i++)
for(j=0 ; j<W ; j++)
for(k=0 ; k<=3 ; k++)
{
y=i+Dy[k];
x=j+Dx[k];
if(y>=0 && y<H && x>=0 && x<W)
{
Red+=abs(R[y][x]-R[i][j]);
Green+=abs(G[y][x]-G[i][j]);
Blue+=abs(B[y][x]-B[i][j]);
}
}
Red/=4.0*H*W;
Green/=4.0*H*W;
Blue/=4.0*H*W;
Color=Red+Green+Blue;
if(Color<=9)
return 4;
else if(Color>=54)
return 3;
else if(Color>=22)
return 2;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |