제출 #1012564

#제출 시각아이디문제언어결과실행 시간메모리
1012564parsadox2미술 수업 (IOI13_artclass)C++17
0 / 100
174 ms6484 KiB
#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;

int sr[500][500] , sg[500][500] , sb[500][500];

int style(int h , int w , int R[500][500] , int G[500][500] , int B[500][500])
{
	srand(time(NULL));
	long long sum = 0 , all = 0 , eq = 0 , all2 = 0;
	for(int i = 0 ; i < w ; i++)  for(int j = 0 ; j < h ; j++)  for(int ii = max(i - 10 , 0) ; ii <= i ; ii++)
	{
		for(int jj = max(j - 10 , 0) ; jj <= min(h - 1 , j + 10) ; jj++)
		{
			int tmp = 0;
			tmp = max({abs(R[i][j] - R[ii][jj]) , abs(G[i][j] - G[ii][jj]) , abs(B[i][j] - B[ii][jj])});
			all2++;
			if(tmp <= 10)
				eq++;
		}
	}
	for(int i = 0 ; i < w ; i++)  for(int j = 0 ; j < h ; j++)
	{
		all++;
		int r = R[i][j] , g = G[i][j] , b = B[i][j];
		if(g + 15 > r && g + 15 > b)
			sum++;
	}
	//cout << eq << " " << sum << " " << all << endl;
	long double t1 = 1.0 * eq / all2;
	long double t2 = 1.0 * sum / all;
	cout << setprecision(6) << fixed << t1 << " " << t2 << endl;
	all += all/5;
	vector <int> vec = {3 , 4};
	if(t1 > 0.5)
	{
		if(t2 > 0.5)
			return 1;
		else
			return 4;
	}
	if(t1 < 0.2)
		return 3;
	if(t2 > 0.5)
		return 2;
	return rand() % 3 + 1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...