kyopro library

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

View the Project on GitHub Chipppppppppp/kyopro

:warning: kpr/template/chmin_chmax.hpp

Required by

Code

#pragma once

namespace kpr {
    // assign min

    [[maybe_unused]] inline constexpr struct {
        template<class T, class U = T>
        constexpr bool operator ()(T& a, const U& b) const noexcept {
            if (a > b) {
                a = b;
                return true;
            }
            return false;
        }
    } chmin;

    // assign max

    [[maybe_unused]] inline constexpr struct {
        template<class T, class U = T>
        constexpr bool operator ()(T& a, const U& b) const noexcept {
            if (a < b) {
                a = b;
                return true;
            }
            return false;
        }
    } chmax;
} // namespace kpr
#line 2 "kpr/template/chmin_chmax.hpp"

namespace kpr {
    // assign min

    [[maybe_unused]] inline constexpr struct {
        template<class T, class U = T>
        constexpr bool operator ()(T& a, const U& b) const noexcept {
            if (a > b) {
                a = b;
                return true;
            }
            return false;
        }
    } chmin;

    // assign max

    [[maybe_unused]] inline constexpr struct {
        template<class T, class U = T>
        constexpr bool operator ()(T& a, const U& b) const noexcept {
            if (a < b) {
                a = b;
                return true;
            }
            return false;
        }
    } chmax;
} // namespace kpr
Back to top page