随笔分类 - 数论—线性筛
摘要:容易看出是用质因数凑n 首先01个因数的情况可以特判,2个的情况就是ap1+bp2=n,b=n/p2(mod p1),这里的b是最小的特解,求出来看bp2 include include include using namespace std; const int N=200005,M=316000
阅读全文
摘要:看着就像反演,所以先推式子(默认n include using namespace std; const int N=5000005,mod=1e9+7; int T,k,n,m,p[N],tot,s[N],f[N],sm[N],ans; bool v[N]; int read() { int r=
阅读全文
摘要:数论+爆搜 详见这位大佬https://blog.csdn.net/eolv99/article/details/39644419 cpp include include include using namespace std; const int N=100000; int s,p[N+5],to
阅读全文
摘要:设n m,答案是\\( C_n^m \\),然后高精就行了 具体做法是先把指数筛出来,然后对每个数因数分解,记录质因子个数,最后被除数减去除数质因子个数,把剩下的质因子乘起来就行了
阅读全文