proconlib

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub anqooqie/proconlib

:heavy_check_mark: std::gcd(m, n) extended for my library (tools/gcd.hpp)

template <typename M, typename N>
constexpr std::common_type_t<M, N> gcd(M m, N n);

If std::gcd(m, n) is available, it returns std::gcd(m, n).

tools::gcd(m, n) will be extended by other header files in my library. For example, tools::gcd(tools::bigint, tools::bigint) gets available if you include tools/bigint.hpp.

Constraints

Time Complexity

License

Author

Required by

Verified with

Code

#ifndef TOOLS_GCD_HPP
#define TOOLS_GCD_HPP

#include <type_traits>
#include <numeric>

namespace tools {
  template <typename M, typename N>
  constexpr ::std::common_type_t<M, N> gcd(const M m, const N n) {
    return ::std::gcd(m, n);
  }
}

#endif
#line 1 "tools/gcd.hpp"



#include <type_traits>
#include <numeric>

namespace tools {
  template <typename M, typename N>
  constexpr ::std::common_type_t<M, N> gcd(const M m, const N n) {
    return ::std::gcd(m, n);
  }
}


Back to top page