# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57400 | fredbr | Art Class (IOI13_artclass) | C++17 | 129 ms | 3672 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>
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int i,j;
int sum=0;
int dis=0;
for(i=0;i<H;i++)for(j=0;j<W;j++){
if(i!=0)dis+=abs(R[i][j]-R[i-1][j])+abs(G[i][j]-G[i-1][j])+abs(B[i][j]-B[i-1][j]);
if(j!=0)dis+=abs(R[i][j]-R[i][j-1])+abs(G[i][j]-G[i][j-1])+abs(B[i][j]-B[i][j-1]);
}
if((double)dis/H/W > 115)return 3;
if((double)dis/H/W < 20)return 4;
for(i=0;i<H;i++)for(j=0;j<W;j++)sum+=G[i][j];
double t=(double)sum/H/W;
if(t<115)return 2;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |