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: fenwick tree add structure
(src/utility/fenwick_tree/add.hpp)

概要

zawa::fenwick_treeにのせる構造体です。一般的な加法を提供します。

機能

Required by

Verified with

Code

#pragma once

namespace zawa {

template <class dat_type>
struct add_structure {
	using T = dat_type;
	static constexpr T id = T{};
	static T add(const T& a, const T& b) {
		return a + b;
	}
	static T inverse(const T& a) {
		return -a;
	}
};

} // namespace zawa
#line 2 "src/utility/fenwick_tree/add.hpp"

namespace zawa {

template <class dat_type>
struct add_structure {
	using T = dat_type;
	static constexpr T id = T{};
	static T add(const T& a, const T& b) {
		return a + b;
	}
	static T inverse(const T& a) {
		return -a;
	}
};

} // namespace zawa
Back to top page