Diff
Not logged in

Differences From Artifact [c76c99fca94dfde1]:

To Artifact [d49aef5cfc6580a0]:


25 25 mint operator*(mint x, mint y) { return x*=y; } 26 26 27 27 mint POW(mint x, LL e) { mint v=1; for(;e;x*=x,e>>=1) if(e&1) v*=x; return v; } 28 28 mint& operator/=(mint& x, mint y) { return x *= POW(y, MODVAL-2); } 29 29 mint operator/(mint x, mint y) { return x/=y; } 30 30 31 31 vector<mint> FAC_(1,1); 32 -mint FAC(LL n) { while( FAC_.size()<=n ) FAC_.push_back( FAC_.back()*FAC_.size() ); return FAC_[n]; } 32 +mint FAC(LL n) { while( FAC_.size()<=n ) FAC_.push_back( FAC_.back()*LL(FAC_.size()) ); return FAC_[n]; } 33 33 34 34 // nCk :: O(log MODVAL) time, O(n) space. 35 35 mint C(LL n, LL k) { return k<0 || n<k ? 0 : FAC(n) / (FAC(k) * FAC(n-k)); } 36 36 37 37 // nCk :: O(1) time, O(n^2) space. 38 38 vector< vector<mint> > CP_; 39 39 mint C(int n, int k) {