This documentation is automatically generated by online-judge-tools/verification-helper
#include "math/logarithm.hpp"#pragma once
#include "./base.hpp"
#include <cassert>
namespace matumoto {
constexpr int logarithm(ll base, ll n) {
assert(base != 0);
int cnt = 0;
while (n % base == 0) {
n /= base;
cnt++;
}
return cnt;
}
} // namespace matumoto#line 2 "math/logarithm.hpp"
#line 2 "math/base.hpp"
namespace matumoto {
using namespace std;
using ll = long long;
} // namespace matumoto
#line 4 "math/logarithm.hpp"
#include <cassert>
namespace matumoto {
constexpr int logarithm(ll base, ll n) {
assert(base != 0);
int cnt = 0;
while (n % base == 0) {
n /= base;
cnt++;
}
return cnt;
}
} // namespace matumoto