library

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

View the Project on GitHub sash2104/library

:heavy_check_mark: monoid/add_count.hpp

Verified with

Code

#ifndef __MONOID__ADD__COUNT
#define __MONOID__ADD__COUNT
#include <algorithm>
#include <utility>
#include <limits>

namespace monoid {
template <class T>
struct add_count {
  typedef std::pair<T,T> value_t;
  value_t identity() const { return std::make_pair(T(),T()); }
  value_t merge(value_t a, value_t b) const { return std::make_pair(a.first+b.first, a.second+b.second); }
};
} // namespace monoid

#endif // __MONOID__ADD__COUNT
#line 1 "monoid/add_count.hpp"


#include <algorithm>
#include <utility>
#include <limits>

namespace monoid {
template <class T>
struct add_count {
  typedef std::pair<T,T> value_t;
  value_t identity() const { return std::make_pair(T(),T()); }
  value_t merge(value_t a, value_t b) const { return std::make_pair(a.first+b.first, a.second+b.second); }
};
} // namespace monoid
Back to top page