From 839946290571c2a02a28bb3f0749ec937d03dc02 Mon Sep 17 00:00:00 2001 From: Bjorn Date: Tue, 16 Jun 2020 03:32:50 +0200 Subject: [PATCH] Fixed erroneous inequality --- pyrival/algebra/mod_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrival/algebra/mod_template.py b/pyrival/algebra/mod_template.py index 73203ca..a6973d7 100644 --- a/pyrival/algebra/mod_template.py +++ b/pyrival/algebra/mod_template.py @@ -2,7 +2,7 @@ This template is useful for problems involving a prime modulo. The template contains a fast function for calculating a * b % MOD, as well as precalculating factorial, inverse factorial, modular inverse -for all numbers <= maxN in O(maxN) time. +for all integers < maxN in O(maxN) time. With this template, one can for example quickly calculate n choose k mod MOD, or calculate matrix multiplication mod MOD. @@ -38,7 +38,7 @@ def modmul(a, b): modmul = fast_modder(MOD) def mod_precalc(): - """ Calculates fac, inv_fac and mod_inv for i <= maxN in O(maxN) time """ + """ Calculates fac, inv_fac and mod_inv for i < maxN in O(maxN) time """ assert maxN <= MOD fac = [1] * maxN