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: minMonoid (最小値モノイド)
(src/utility/monoid/minMonoid.hpp)

概要

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

機能

zawa::minMonoid<T>

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

メンバなど

valueType

using valueType = T

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

identity

static constexpr valueType identity

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

operation

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

std::min(a, b)

Verified with

Code

#pragma once

#include <algorithm>
#include <limits>

namespace zawa {

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

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

#include <algorithm>
#include <limits>

namespace zawa {

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

};
Back to top page