제출 #4587

#제출 시각아이디문제언어결과실행 시간메모리
4587cki86201미술 수업 (IOI13_artclass)C++98
96 / 100
152 ms3580 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...