Submission #1218752

#TimeUsernameProblemLanguageResultExecution timeMemory
1218752ereringArt Class (IOI13_artclass)C++20
78 / 100
32 ms3340 KiB
#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]) {
    int sum=0,cnt=1;
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            if(i>0){
                cnt++;
                sum+=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){
                cnt++;
                sum+=abs(R[i][j]-R[i][j-1])+abs(G[i][j]-G[i][j-1])+abs(B[i][j]-B[i][j-1]);
            }
        }
    }
    sum/=H*W;
    if(sum<12)return 4;
    if(sum>90)return 3;
    if(sum>40)return 2;
    return 1;
   /* if(sum)
    std::cout<<sum<<endl;
    return 1;
    /*
     * 1:
     * 34
     * 35
     * 20
     * 50
     * 34
     * 43
     *
     * 2:
     * 42
     * 54
     * 29
     * 41
     * 90
     *
     * 3:
     * 148
     * 100
     * 112
     * 118
     * 50
     *
     * 4:
     * 6
     * 8
     * 4
     *
     */
}
#Verdict Execution timeMemoryGrader output
Fetching results...