传送门 证明自己学过exLucas 这题计算的是本质不相同的排列数量,不难得到答案是\(\frac{n!}{\prod\limits_{i=1}^m w_i! \times (n - \sum\limits_{i=1}^m w_i)!}\) 但是模数不一定是质数,于是用exLucas计算即可. #include<bits/stdc++.h> #define int long long //This code is written by Itst using namespace std; int…
求$C_n^m mod p$,其中p不是质数且不保证p能分解为几个不同质数的乘积(也就是不能用crt合并) #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define re register #define int long long using namespace std; int n,m,p; int q_pow(int a,int b,int p){…
CRT, lucas及其扩展形式 exgcd int exgcd(int a, int b, int &x, int &y) { if (b == 0) return a, x = 1, y = 0; int y = exgcd(b, a % b, x, y), t; t = x, x = y, y = t - a / b * y; } 证明: gcd的过程中, 假设我们已经求出了\(b * x + (a~\%~b) * y = gcd(a, b)\)推导到\(a*x + b*y = gc…
有一段时间没有用到AnkhSvn了,今天工作需要安装了一下.结果安装到一半就无法继续了,提示An error occurred during the installation of assembly 'Microsoft.VC90.CRT,publicKeyToken="1fc8b3b9a1e18e3b",version="9.0.30729.6161",processorArchitecture="x86",type="win32&q…
SSL连接作用不说,百度很多.因为最近想考虑重构一些功能,在登录这块有打算弄成HTTPS的,然后百度了,弄成了,就记录一下,以便以后万一部署的时候忘记掉. 做实验的时候,拿的我个人申请的已经备案的域名,暂定为 xxx.com,需要做SSL的是 login.xxx.com,服务器申请的是阿里云的一台ECS,弄好了IIS环境等. 一开始申请了阿里云的ca证书,里面有一个wosign免费DV证书(DV就是单验证域名所有权的,对应的还有 OV EV ,反正价格不一样,最贵的浏览器有绿色标志,反正我是没钱…