cpp-library

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

View the Project on GitHub 9tc/cpp-library

:x: 最大公約数(ユークリッドの互除法)
(math/gcd.hpp)

Required by

Verified with

Code

#pragma once
template <class T>
T GCD(T a, T b){
  if(b == 0) return a;
  return GCD(b, a % b);
}
#line 2 "math/gcd.hpp"
template <class T>
T GCD(T a, T b){
  if(b == 0) return a;
  return GCD(b, a % b);
}
Back to top page