Algorithms

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

View the Project on GitHub HyunjaeLee/Algorithms

:heavy_check_mark: monoids/xor.hpp

Verified with

Code

#ifndef XOR_HPP
#define XOR_HPP

// Xor Abelian Group
template <typename T> struct Xor {
    T val;
    static Xor op(Xor a, Xor b) { return {a.val ^ b.val}; }
    static Xor e() { return {0}; }
    static Xor inv(Xor x) { return x; }
    friend bool operator==(const Xor &a, const Xor &b) { return a.val == b.val; }
};

#endif // XOR_HPP
#line 1 "monoids/xor.hpp"



// Xor Abelian Group
template <typename T> struct Xor {
    T val;
    static Xor op(Xor a, Xor b) { return {a.val ^ b.val}; }
    static Xor e() { return {0}; }
    static Xor inv(Xor x) { return x; }
    friend bool operator==(const Xor &a, const Xor &b) { return a.val == b.val; }
};
Back to top page