如果写过 LJJ 学二项式那道题的话这道题就不难了. #include <bits/stdc++.h> #define ll long long #define setIO(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout) using namespace std; int K,bu[10000],G; ll Mod,N; struct M { ll a…
这道题是求组合数终极版. C(n,m) mod P n>=1e9 m>=1e9 P>=1e9且为合数且piqi<=1e5 拓展lucas定理. 实际上就是一点数论小知识的应用. 这篇文章对于CRT和lucas定理的学习非常不错. #include<bits/stdc++.h> using namespace std; #define ll long long #define FILE "dealing" #define up(i,j,n) for(i…