digitex/
lib.rs

1#[cfg(not(feature = "atcoder"))]
2mod dynamic;
3#[cfg(not(feature = "atcoder"))]
4pub use dynamic::Digit as DynamicDigit;
5
6mod r#static;
7pub use r#static::Digit as StaticDigit;
8
9pub(crate) fn into(mut n: u64, d: u32) -> Vec<u32> {
10    let mut res = Vec::new();
11
12    while n > 0 {
13        let rem = n % d as u64;
14        res.push(rem as u32);
15        n -= rem;
16        n /= d as u64;
17    }
18
19    res.reverse();
20    res
21}