제출 #765268

#제출 시각아이디문제언어결과실행 시간메모리
765268Sohsoh84미술 수업 (IOI13_artclass)C++17
0 / 100
70 ms8960 KiB
#include "artclass.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef long double ld;

#define X		first
#define Y		second
#define sep		' '
#define debug(x)	cerr << #x << ": " << x << endl;

const ll MAXN = 500;
const ld GRTRFACTOR = 0.6;

int n, m, R[MAXN][MAXN], G[MAXN][MAXN], B[MAXN][MAXN];

inline bool green_tree_detector() {
	ld ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (G[i][j] > max(B[i][j], R[i][j]) * 0.6)
				ans = ans + 1;
		}
	}

	debug(ans / (n * m))
	return ans / (n * m) > GRTRFACTOR;
}

int style(int H_, int W_, int R_[500][500], int G_[500][500], int B_[500][500]) {
	n = H_;
	m = W_;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			R[i][j] = R_[i][j], G[i][j] = G_[i][j], B[i][j] = B_[i][j];

	if (green_tree_detector()) return 2;
	return 3;
}
#Verdict Execution timeMemoryGrader output
Fetching results...