# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64552 | TadijaSebez | Art Class (IOI13_artclass) | C++11 | 110 ms | 3632 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 <stdio.h>
const int N=500;
int abs(int x){ return x>0?x:-x;}
int style(int n, int m, int r[N][N], int g[N][N], int b[N][N])
{
int i,j,green=0,yellow=0,gray=0,white=0;
int sz=n*(m-1)+m*(n-1),dif=0;
for(i=0;i<n;i++)
{
for(j=0;j<m-1;j++)
{
dif+=abs(r[i][j]-r[i][j+1])+abs(g[i][j]-g[i][j+1])+abs(b[i][j]-b[i][j+1]);
}
}
for(i=0;i<n-1;i++)
{
for(j=0;j<m;j++)
{
dif+=abs(r[i][j]-r[i+1][j])+abs(g[i][j]-g[i+1][j])+abs(b[i][j]-b[i+1][j]);
}
}
dif/=sz;
if(dif<10) return 4;
if(dif<25) return 1;
if(dif<60) return 2;
return 3;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |