Submission #768009

#TimeUsernameProblemLanguageResultExecution timeMemory
768009Ahmed57Art Class (IOI13_artclass)C++17
3 / 100
54 ms3564 KiB
#include "artclass.h" #include<bits/stdc++.h> using namespace std; int style(int H,int W, int R[500][500],int G[500][500],int B[500][500]){ double all = 0; double ma = 0 , xd = 0; for(int i = 0;i<H;i++){ ma+=G[i][0]; for(int j = 1;j<W;j++){ xd ++; all+=abs(R[i][j]-R[i][j-1]); all+=abs(G[i][j]-G[i][j-1]); ma+=G[i][j]; all+=abs(B[i][j]-B[i][j-1]); } } for(int i = 1;i<H;i++){ for(int j = 0;j<W;j++){ all+=abs(R[i-1][j]-R[i][j]); all+=abs(G[i-1][j]-G[i][j]); all+=abs(B[i-1][j]-B[i][j]); } } ma/=double(H*W); all/=double(xd); if(ma>=200)return 2; if(all<=9)return 4; if(all<=18)return 1; if(all>=25)return 3; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...