Submission #1030056

#TimeUsernameProblemLanguageResultExecution timeMemory
1030056tolbiArt Class (IOI13_artclass)C++17
100 / 100
43 ms6228 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]) {
    function<bool(int,int)> green = [&](int a, int b){
        if (G[a][b]>B[a][b]*1.2) return true;
        return false;
    };
    int totdiff = 0;
    int hehe = 0;
    int treshold1=100;
    int treshold2=60000;
    int treshold3=100000;
    int treshold4=2500;
    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            if (green(i,j)) hehe++;
            if (i) {
                int diff = 0;
                diff+=abs(R[i][j]-R[i-1][j]);
                diff+=abs(G[i][j]-G[i-1][j]);
                diff+=abs(B[i][j]-B[i-1][j]);
                if (diff>treshold1) totdiff++;
            }
            if (j) {
                int diff = 0;
                diff+=abs(R[i][j]-R[i-1][j]);
                diff+=abs(G[i][j]-G[i-1][j]);
                diff+=abs(B[i][j]-B[i-1][j]);
                if (diff>treshold1) totdiff++;
            }
        }
    }
    if (totdiff>treshold2) return 3;
    if (totdiff<treshold4) return 4;
    if (hehe>treshold3) return 2;
    return 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...