Skip to content

Commit f7fd836

Browse files
lrvideckisweb-flow
andauthored
Choose nit (#126)
* nit * [auto-verifier] verify commit 1481280 --------- Co-authored-by: GitHub <noreply@github.com>
1 parent e03e89b commit f7fd836

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.verify-helper/timestamps.remote.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2024-12-14 19:50:29 -0600",
7575
"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2024-12-15 14:34:10 -0600",
7676
"tests/library_checker_aizu_tests/handmade_tests/mod_int.test.cpp": "2024-12-14 19:50:29 -0600",
77-
"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2024-12-14 19:50:29 -0600",
77+
"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2025-01-15 00:15:03 -0700",
7878
"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2024-12-14 15:47:13 -0600",
7979
"tests/library_checker_aizu_tests/handmade_tests/rmq_small_n.test.cpp": "2024-12-14 19:50:29 -0600",
8080
"tests/library_checker_aizu_tests/handmade_tests/sa_find_subarray.test.cpp": "2024-12-14 19:50:29 -0600",
@@ -86,15 +86,15 @@
8686
"tests/library_checker_aizu_tests/loops/supermasks.test.cpp": "2024-11-17 14:04:03 -0600",
8787
"tests/library_checker_aizu_tests/math/binary_exponentiation_mod.test.cpp": "2024-11-17 14:04:03 -0600",
8888
"tests/library_checker_aizu_tests/math/binary_matrix_mult.test.cpp": "2024-11-17 14:04:03 -0600",
89-
"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2024-12-15 14:34:10 -0600",
89+
"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2025-01-15 00:15:03 -0700",
9090
"tests/library_checker_aizu_tests/math/derangement.test.cpp": "2024-11-17 14:04:03 -0600",
9191
"tests/library_checker_aizu_tests/math/matrix_determinant.test.cpp": "2024-12-14 15:47:13 -0600",
9292
"tests/library_checker_aizu_tests/math/matrix_mult.test.cpp": "2024-11-17 14:04:03 -0600",
9393
"tests/library_checker_aizu_tests/math/mod_int_derangement.test.cpp": "2024-11-17 14:04:03 -0600",
9494
"tests/library_checker_aizu_tests/math/mod_int_gcd_convolution.test.cpp": "2024-11-17 14:04:03 -0600",
9595
"tests/library_checker_aizu_tests/math/mod_int_n_choose_k.test.cpp": "2024-11-17 14:04:03 -0600",
9696
"tests/library_checker_aizu_tests/math/mod_int_tetration.test.cpp": "2024-11-17 14:04:03 -0600",
97-
"tests/library_checker_aizu_tests/math/n_choose_k.test.cpp": "2024-11-17 14:04:03 -0600",
97+
"tests/library_checker_aizu_tests/math/n_choose_k.test.cpp": "2025-01-15 00:15:03 -0700",
9898
"tests/library_checker_aizu_tests/math/num_subsequences.test.cpp": "2024-11-17 14:04:03 -0600",
9999
"tests/library_checker_aizu_tests/math/partitions.test.cpp": "2024-11-17 14:04:03 -0600",
100100
"tests/library_checker_aizu_tests/math/prime_sieve.test.cpp": "2024-11-22 11:54:52 -0600",

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
}

0 commit comments

Comments
 (0)