# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8038 | gs13105 | Art Class (IOI13_artclass) | C++98 | 139 ms | 3584 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"
inline int ab(int a)
{
return a<0?-a:a;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
int s=0,c=0,i,j;
double t;
for(i=1;i<H;i++)
{
c++;
s+=ab(R[i][0]-R[i-1][0]);
s+=ab(G[i][0]-G[i-1][0]);
s+=ab(B[i][0]-B[i-1][0]);
}
for(i=1;i<W;i++)
{
c++;
s+=ab(R[0][i]-R[0][i-1]);
s+=ab(G[0][i]-G[0][i-1]);
s+=ab(B[0][i]-B[0][i-1]);
}
for(i=1;i<H;i++)
{
for(j=1;j<W;j++)
{
c++;
s+=ab(R[i][j]-R[i-1][j]);
s+=ab(G[i][j]-G[i-1][j]);
s+=ab(B[i][j]-B[i-1][j]);
c++;
s+=ab(R[i][j]-R[i][j-1]);
s+=ab(G[i][j]-G[i][j-1]);
s+=ab(B[i][j]-B[i][j-1]);
}
}
t=(double)s/c;
if(t>=55)
return 3;
if(t>=24)
return 2;
if(t>=9)
return 1;
return 4;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |