algorithm-dev

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

View the Project on GitHub today2098/algorithm-dev

:warning: 値の変換を行うユーティリティライブラリ
(algorithm/Utils/convert.hpp)

Code

#ifndef ALGORITHM_CONVERT_HPP
#define ALGORITHM_CONVERT_HPP 1

namespace algorithm {

template <typename Type>
bool chmin(Type &a, const Type &b) {
    if(a <= b) return false;
    a = b;
    return true;
}

template <typename Type>
bool chmax(Type &a, const Type &b) {
    if(a >= b) return false;
    a = b;
    return true;
}

}  // namespace algorithm

#endif
#line 1 "algorithm/Utils/convert.hpp"



namespace algorithm {

template <typename Type>
bool chmin(Type &a, const Type &b) {
    if(a <= b) return false;
    a = b;
    return true;
}

template <typename Type>
bool chmax(Type &a, const Type &b) {
    if(a >= b) return false;
    a = b;
    return true;
}

}  // namespace algorithm
Back to top page