题解 | 牛群全排列数

牛群全排列数

https://www.nowcoder.com/practice/5ab233c23fcc4c69b81bd5a66c07041c

import java.util.*;


public class Solution {
    private static final int mod = 1000000007;
    public int factorial (int n) {
        if (n == 1) {
            return 1;
        }
        return (int)((long)n * (long)factorial(n - 1) % mod);
    }
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务