제출 #8048

#제출 시각아이디문제언어결과실행 시간메모리
8048gs14004Art Class (IOI13_artclass)C++98
82 / 100
159 ms3692 KiB
#include "artclass.h"
#include <cstdlib>
#include <cmath>

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
    double delta = 0;
    for (int i=0; i<H; i++) {
        for (int j=0; j<W-1; j++) {
            delta += sqrt(abs(R[i][j+1] - R[i][j]) + abs(G[i][j+1] - G[i][j]) + abs(B[i][j+1] - B[i][j]));
        }
    }
    for (int j=0; j<W; j++) {
        for (int i=0; i<H-1; i++) {
            delta += sqrt(abs(R[i][j] - R[i+1][j]) + abs(G[i][j] - G[i+1][j]) + abs(B[i][j] - B[i+1][j]));
        }
    }
    double t = 100.0 * delta / (2 * W * H - H - W);
    if(t < 250) return 4;
    else if(t < 450) return 1;
    else if(t < 675) return 2;
    return 3;
}
#Verdict Execution timeMemoryGrader output
Fetching results...