제출 #61309

#제출 시각아이디문제언어결과실행 시간메모리
61309dukati8미술 수업 (IOI13_artclass)C++14
12 / 100
132 ms3612 KiB
#include <stdio.h> #include "artclass.h" #include <bits/stdc++.h> #include <iostream> using namespace std; #define rep(i,a,b) for(int i=a;i<int(b);i++) int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { //Check sum of all pixels double totr,totb,totg; totr=0;totb=0;totg=0; rep (i,0,H) { rep (j,0,W) { totr+=R[i][j]; totb+=B[i][j]; totg+=G[i][j]; } } totr/=H*W; totb/=H*W; totg/=H*W; double hi=max(totr,max(totg,totb)); double lo=min(totr,min(totg,totb)); double med=totr+totg+totb-hi-lo; double diff1=hi-med; double diff2=med-lo; //cout << totr << " " << totg << " " << totb<<endl; if (lo*1.3>hi) return 3; if (abs(diff1-diff2)<min(diff1,diff2)) return 3; if (lo*3<hi) return 4; if (1.2*totb<totg && 1.3*totb<totr && totg+totr+totb<350) return 2; if (totg+totr+totb<500) return 1; //Check for 10*10 square that is relatively white return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...