제출 #140079

#제출 시각아이디문제언어결과실행 시간메모리
140079cfalas미술 수업 (IOI13_artclass)C++14
1 / 100
86 ms3448 KiB
#include<bits/stdc++.h>
using namespace std;
#include "artclass.h"
typedef pair<int, int> ii;
typedef pair<int, ii> iii;

int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
	double tot = 0;
	double totr=0, totg=0, totb=0;
	set<iii> colors;
	int dr=0, dg=0, db=0;
	for(int i=3;i<h;i++){
		for(int j=0;j<w;j++){
			tot+=r[i][j]+g[i][j]+b[i][j];
			totr+=r[i][j];
			totg+=g[i][j];
			totb+=b[i][j];
			colors.insert(iii(r[i][j]/25, ii(g[i][j]/25, b[i][j]/25)));
			if(r[i][j]>g[i][j] && r[i][j]>b[i][j]) dr++;
			if(g[i][j]>b[i][j] && g[i][j]>r[i][j]) dg++;
			if(b[i][j]>r[i][j] && b[i][j]>g[i][j]) db++;
		}
	}
	if(dr-dg-db>90000) return 2;
	if(colors.size()<=80) return 4;
	if(colors.size()>=150) return 3;
	if(totg > totb && totb<totr) return 2;
	return 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...