Skip to content

Commit f7fdb81

Browse files
committed
change C->ch to fix name clash with KACTL's typedef complex<double> C;
1 parent 419bebf commit f7fdb81

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

library/math/n_choose_k/grow.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ struct comb {
55
};
66
vector<comb> t(2);
77
void grow(int n) {
8-
while (sz(t) <= n) {
9-
ll i = sz(t),
10-
inv = mod - (mod / i) * t[mod % i].inv % mod;
8+
rep(i, sz(t), n + 1) {
9+
ll inv = mod - (mod / i) * t[mod % i].inv % mod;
1110
t.push_back({inv, i * t[i - 1].fact % mod,
1211
inv * t[i - 1].inv_fact % mod});
1312
}

library/math/n_choose_k/lucas_theorem.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ ll lucas(ll n, ll k) {
77
if (k < 0 || n < k) return 0;
88
ll res = 1;
99
for (; k && k < n && res; n /= mod, k /= mod)
10-
res = res * C(n % mod, k % mod) % mod;
10+
res = res * ch(n % mod, k % mod) % mod;
1111
return res;
1212
}

library/math/n_choose_k/n_choose_k.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
//! n,k < mod
44
//! @time O(1) amortized
55
//! @space O(1) amortized
6-
// NOLINTNEXTLINE(readability-identifier-naming)
7-
ll C(int n, int k) {
6+
ll ch(int n, int k) {
87
if (k < 0 || n < k) return 0;
98
grow(n);
109
return t[n].fact * t[k].inv_fact % mod *

0 commit comments

Comments
 (0)