제출 #102863

#제출 시각아이디문제언어결과실행 시간메모리
102863wxh010910미술 수업 (IOI13_artclass)C++17
78 / 100
327 ms3448 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]) { double ave = 0, var = 0; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { int foo = 0, bar = 0, baz = 0; for (int x = i - 5; x <= i + 5; ++x) { for (int y = j - 5; y <= j + 5; ++y) { if (x >= 0 && x < H && y >= 0 && y < W) { foo += abs(R[x][y] - R[i][j]) + abs(G[x][y] - G[i][j]) + abs(B[x][y] - B[i][j]); bar += (R[x][y] - R[i][j]) * (R[x][y] - R[i][j]) + (G[x][y] - R[i][j]) * (G[x][y] - G[i][j]) + (B[x][y] - R[i][j]) * (B[x][y] - B[i][j]); baz += 1; } } } ave += (double) foo / baz; var += (double) bar / baz; } } ave /= 3 * H * W; var /= 3 * H * W; if (ave < 6) { return 4; } else if (ave > 30) { return 3; } else if (var > 1000) { return 1; } else { return 2; } }
#Verdict Execution timeMemoryGrader output
Fetching results...