제출 #1022102

#제출 시각아이디문제언어결과실행 시간메모리
1022102amine_aroua미술 수업 (IOI13_artclass)C++17
80 / 100
65 ms3412 KiB
#include "artclass.h" #include<bits/stdc++.h> using namespace std; const int BASE = 256; const int eps = 50; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { int cnt = 0; int mn[3] = {R[0][0] , G[0][0] , B[0][0]}; int mx[3] = {R[0][0] , G[0][0] , B[0][0]}; for(int i = 0 ; i < H ; i++) { for(int j = 0 ; j < W ; j++) { mn[0] = min(mn[0] , R[i][j]); mx[0] = max(mx[0] ,R[i][j]); mn[1] = min(mn[1] , G[i][j]); mx[1] = max(mx[1] ,G[i][j]); mn[2] = min(mn[2] , B[i][j]); mx[2] = max(mx[2] ,B[i][j]); for(int k = 0 ; k < 3 ; k++) { if(mx[k] - mn[k] > eps) { cnt++; mn[0] = mx[0] = R[i][j]; mn[1] = mx[1] = G[i][j]; mn[2] = mx[2] = B[i][j]; break; } } } } if(cnt <= 4000) return 4; else if(cnt <= 9000) return 1; else if(cnt <= 38000) return 2; return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...