Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bf7d25a

Browse files
Update Readme.md
1 parent 2e5ac27 commit bf7d25a

File tree

1 file changed

+2
-1
lines changed
  • Math/3463.Check-If-Digits-Are-Equal-in-String-After-Operations-II

1 file changed

+2
-1
lines changed

‎Math/3463.Check-If-Digits-Are-Equal-in-String-After-Operations-II/Readme.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ where inv(b) = b^(p-2) and b cannot be divided by p.
1313
```
1414
这里的p非常小,分别是2和5,很容易被组合数计算表达式的分母整除。
1515

16-
因此此题涉及到了一个非常专业的知识点,Lucas定理。见https://oi-wiki.org/math/number-theory/lucas/
16+
因此此题涉及到了一个生僻的知识点,Lucas定理。见https://oi-wiki.org/math/number-theory/lucas/
1717
```
1818
long long Lucas(long long n, long long m, long long p) {
1919
if (m == 0) return 1;
2020
return (C(n % p, m % p, p) * Lucas(n / p, m / p, p)) % p;
2121
}
2222
```
23+
用这个函数,我们就直接求得了`C(n,i)%p`的值,再作为nums[i]的系数带入计算。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /