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: gcdStructure (Sparse Table)
(src/utility/sparseTable/gcdStructure.hpp)

概要

Sparse Tableで区間最小公倍数クエリを処理したい時に、zawa::sparseTable<structure>structureに入れる構造体です。

機能

zawa::gcdStructure<T>

Verified with

Code

#include <numeric>

namespace zawa {

template <class T>
struct gcdStructure {
	using valueType = T;
	static valueType operation(const valueType& a, const valueType& b) {
		return std::gcd(a, b);
	}
};

} // namespace zawa
#line 1 "src/utility/sparseTable/gcdStructure.hpp"
#include <numeric>

namespace zawa {

template <class T>
struct gcdStructure {
	using valueType = T;
	static valueType operation(const valueType& a, const valueType& b) {
		return std::gcd(a, b);
	}
};

} // namespace zawa
Back to top page