제출 #17221

#제출 시각아이디문제언어결과실행 시간메모리
17221muratArt Class (IOI13_artclass)C++98
100 / 100
152 ms3716 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]) {

    int all = 0, sc = 0;

    for(int i = 0; i < H; i++)
        for(int j = 0; j < W; j++) {
            if(j < W-1) all += abs(R[i][j] - R[i][j+1]);
            if(i < H-1) all += abs(R[i][j] - R[i+1][j]);
            if(j < W-1) all += abs(B[i][j] - B[i][j+1]);
            if(i < H-1) all += abs(B[i][j] - B[i+1][j]);
            if(j < W-1) all += abs(G[i][j] - G[i][j+1]);
            if(i < H-1) all += abs(G[i][j] - G[i+1][j]);
            if(j < W-1) sc++;
            if(i < H-1) sc++;

        }

    double ans = all / 1.0 / sc;

    if(ans >= 56) return 3;
    if(ans >= 24) return 2;
    if(ans >= 9) return 1;
    return 4;
}
#Verdict Execution timeMemoryGrader output
Fetching results...