From 9595eaf55edbaa63500b5038fa03d1a59fefcde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Renison?= <85908989+IvanRenison@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:18:50 -0300 Subject: [PATCH] Make multinomial shorter (#272) --- content/combinatorial/multinomial.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/combinatorial/multinomial.h b/content/combinatorial/multinomial.h index 8e7957312..8f7177b5c 100644 --- a/content/combinatorial/multinomial.h +++ b/content/combinatorial/multinomial.h @@ -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; }