Skip to content

Commit

Permalink
Make multinomial shorter (kth-competitive-programming#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRenison authored and KacperTopolski committed Oct 22, 2024
1 parent bc68a61 commit 9595eaf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions content/combinatorial/multinomial.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

ll multinomial(vi& v) {
ll c = 1, m = v.empty() ? 1 : v[0];
fwd(i,1,sz(v)) rep(j,v[i])
c = c * ++m / (j+1);
fwd(i,1,sz(v)) rep(j,v[i]) c = c * ++m / (j+1);
return c;
}

0 comments on commit 9595eaf

Please sign in to comment.