library

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

View the Project on GitHub gyouzasushi/library

:heavy_check_mark: Group: Add
(algebra/group_add.hpp)

Depends on

Verified with

Code

#pragma once
#include "algebra/monoid_add.hpp"
template <class T>
struct group_add : monoid_add<T> {
    static T inv(T a) {
        return -a;
    }
};
#line 2 "algebra/monoid_add.hpp"
template <class T>
struct monoid_add {
    using S = T;
    static S op(S a, S b) {
        return a + b;
    }
    static S e() {
        return T(0);
    }
};
#line 3 "algebra/group_add.hpp"
template <class T>
struct group_add : monoid_add<T> {
    static T inv(T a) {
        return -a;
    }
};
Back to top page