Submission #57400

#TimeUsernameProblemLanguageResultExecution timeMemory
57400fredbrArt Class (IOI13_artclass)C++17
96 / 100
129 ms3672 KiB
#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 timeMemoryGrader output
Fetching results...