# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8508 | gs13023 | Art Class (IOI13_artclass) | C++98 | 119 ms | 3700 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"
int abs(int a){return a>0?a:-a;}
int max(int a,int b){return a>b?a:b;}
int style(int H,int W,int R[500][500],int G[500][500],int B[500][500])
{
//1 몬드리안 //2 숲 //3 뿌리는거 //4 창호지
int dif1[3][500][500];
int dif2[3][500][500];
int M=0;
for(int i=0;i<H;i++)
{
for(int j=0;j<W-1;j++)
{
dif1[0][i][j]=R[i][j+1]-R[i][j];
dif1[1][i][j]=G[i][j+1]-G[i][j];
dif1[2][i][j]=B[i][j+1]-B[i][j];
M=max(M,G[i][j]);
}
}
for(int i=0;i<H-1;i++)
{
for(int j=0;j<W;j++)
{
dif2[0][i][j]=R[i+1][j]-R[i][j];
dif2[1][i][j]=G[i+1][j]-G[i][j];
dif2[2][i][j]=B[i+1][j]-B[i][j];
}
}
int GG=0;
for(int i=0;i<H;i++)
{
for(int j=0;j<W;j++)
{
GG+=G[i][j];
}
}
int cnt=0,cnt2=0;
for(int i=0;i<H;i++)
{
for(int j=0;j<W;j++)
{
int a=0,b=0;
for(int k=0;k<3;k++)
{
a+=(dif1[k][i][j]>20);
b+=(dif2[k][i][j]>20);
}
if(a)cnt++;
if(b)cnt2++;
}
}
// if(GG>H*W*(M/2))return 2;
// if(cnt+cnt2<(H+W)*15)return 4;
// if(cnt+cnt2<(H+W)*50)return 1;
// return 3;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |