zawatins-library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub zawa-tin/zawatins-library

:heavy_check_mark: maxMonoid (最大値モノイド)
(src/utility/monoid/maxMonoid.hpp)

概要

max演算のモノイドを表現した構造体です。

機能

zawa::maxMonoid<T>

T: int long long などstd::numeric_limitsが定義されているもの

メンバなど

valueType

using valueType = T

データ構造で利用するために必要なエイリアス

identity

static constexpr value_type identity

単位元、std::numeric_limits<T>::min()

operation

static value_type operation(const value_type& a, const value_type& b)

std::max(a, b)

Verified with

Code

#pragma once

#include <algorithm>
#include <limits>

namespace zawa {

template <class T>
struct maxMonoid {
	using valueType = T;
	static constexpr valueType identity = std::numeric_limits<valueType>::min();
	static valueType operation(const valueType& a, const valueType& b) {
		return std::max(a, b);
	}
};

};
#line 2 "src/utility/monoid/maxMonoid.hpp"

#include <algorithm>
#include <limits>

namespace zawa {

template <class T>
struct maxMonoid {
	using valueType = T;
	static constexpr valueType identity = std::numeric_limits<valueType>::min();
	static valueType operation(const valueType& a, const valueType& b) {
		return std::max(a, b);
	}
};

};
Back to top page