From eb95caa631473b854d073008e9ec2c5ae5de42d3 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 8 Oct 2024 18:38:04 +0800 Subject: [PATCH] update --- src/P2822/P2822.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/P2822/P2822.cpp b/src/P2822/P2822.cpp index d452170..9fe8d80 100644 --- a/src/P2822/P2822.cpp +++ b/src/P2822/P2822.cpp @@ -14,7 +14,7 @@ static ull fact(const ull n)noexcept{ if(it != fact_map.end())return (*it).second; ull ret {1}; for(ull i{2};i<=n;i++){ - ret=(ret*i)%k; + ret=(ret%k*i%k); } fact_map.insert({n,ret}); return ret;