Submission #155902

#TimeUsernameProblemLanguageResultExecution timeMemory
155902qkxwsmArt Class (IOI13_artclass)C++14
7 / 100
85 ms6896 KiB
#include "artclass.h"
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
	if (a > b) a = b;
}
template<class T, class U>
void ckmax(T &a, U b)
{
	if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define SZ(x) ((int) ((x).size()))
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int ans;

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
	//calculate some quantity of
	vector<int> cur;
	FOR(i, 0, H)
	{
		FOR(j, 0, W)
		{
			int mx = max(R[i][j], max(G[i][j], B[i][j]));
			int mn = min(R[i][j], min(G[i][j], B[i][j]));
			cur.PB(mx - mn);
		}
	}
	sort(ALL(cur));
	int val = cur[SZ(cur) / 2];
	if (val <= 21) ans = 0;
	else if (val <= 35) ans = 1;
	else if (val <= 65) ans = 2;
	else ans = 3;
	return ans + 1;
	//calculate the minimum
}
#Verdict Execution timeMemoryGrader output
Fetching results...