如果你 RE at #9 还是用费马小定理求的C
请检查
LL C(LL x,LL y) { if(y>x||x<0||y<0) return 0; LL res=fac[x]; res=(res*inv(fac[y]))%mod; res=(res*inv(fac[x-y]))%mod; return res; }