#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
long double sum=0,cnt=1,C[500][500];
for(int i=0;i<W;i++){
for(int j=0;j<H;j++){
C[i][j]=R[i][j]+B[i][j]+G[i][j];
if(i>0){
cnt++;
sum+=abs(C[i][j]-C[i-1][j]);
}
if(j>0){
cnt++;
sum+=abs(C[i][j]-C[i][j-1]);
}
}
}
sum/=cnt;
// cout<<sum<<endl;
if(sum>45.0)return 3;
if(sum<7.0)return 4;
if(sum<20.0)return 1;
return 2;
/*
* 1:
* 17.0812
* 17.235
* 21.9415
* 16.8533
* 10.3534
*
* 2:
* 20.6226
* 26.4722
* 14.3522
* 20.1279
* 44.1513
* 21.3155
*
* 3:
* 74.368
* 49.9367
* 56.0681
* 59.5703
*
* 4:
* 2.34493
* 3.8781
* 2.26889
*/
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |