제출 #1028668

#제출 시각아이디문제언어결과실행 시간메모리
1028668tolbi미술 수업 (IOI13_artclass)C++17
73 / 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)> white = [&](int a, int b){ if (R[a][b]>150 && G[a][b]>150 && B[a][b]>150) return true; return false; }; function<bool(int,int)> black = [&](int a, int b){ if (R[a][b]<100 && G[a][b]<100 && B[a][b]<100) return true; return false; }; int totdiff = 0; int hehe = 0; int treshold1=30; int treshold2=150000; int treshold3=150; int treshold4=50000; for (int i = 0; i < H; i++){ for (int j = 0; j < W; j++){ 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 (black(i,j) && white(i-1,j)){ hehe++; } if (black(i-1,j) && white(i,j)){ hehe++; } } 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 (black(i,j) && white(i,j-1)){ hehe++; } if (white(i,j) && black(i,j-1)){ hehe++; } } } } if (totdiff>treshold2) return 3; if (hehe>treshold3) return 1; if (totdiff>treshold4) return 2; return 4; }
#Verdict Execution timeMemoryGrader output
Fetching results...