This documentation is automatically generated by online-judge-tools/verification-helper
#include "math/to-base.hpp"#pragma once
#include "./base.hpp"
#include <algorithm>
#include <vector>
namespace matumoto {
// decimal n -> b-ary
template <typename T>
vector<T> to_base(T n, T b) {
if (n == 0 or b <= 1)
return vector<T>{ 0 };
vector<T> res;
for (; n > 0; n /= b) {
res.emplace_back(n % b);
}
reverse(res.begin(), res.end());
return res;
}
} // namespace matumoto#line 2 "math/to-base.hpp"
#line 2 "math/base.hpp"
namespace matumoto {
using namespace std;
using ll = long long;
} // namespace matumoto
#line 4 "math/to-base.hpp"
#include <algorithm>
#include <vector>
namespace matumoto {
// decimal n -> b-ary
template <typename T>
vector<T> to_base(T n, T b) {
if (n == 0 or b <= 1)
return vector<T>{ 0 };
vector<T> res;
for (; n > 0; n /= b) {
res.emplace_back(n % b);
}
reverse(res.begin(), res.end());
return res;
}
} // namespace matumoto