test/cpv/library-checker-enumerative_combinatorics/q_binomial_coefficient_prime_mod.mintd-md.factorial-fact_helper.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #define AUTO_GENERATED | ||
| 2 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/q_binomial_coefficient_prime_mod | ||
| 3 | #include "../../../src/comb/qbinom/lib.hpp" | ||
| 4 | #include "../../../src/io/fastin/lib.hpp" | ||
| 5 | #include "../../../src/io/fastout/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | CEXP u32 MOD = 998244353; | ||
| 9 | |||
| 10 | #include "../../../src/math/ds/mint/md/lib.hpp" | ||
| 11 | #include "../../../src/math/fact/helper/lib.hpp" | ||
| 12 | |||
| 13 | using namespace tifa_libs; | ||
| 14 | using mint = mint_md<__LINE__>; | ||
| 15 | using namespace tifa_libs; | ||
| 16 | using fact_t = fact_helper<mint>; | ||
| 17 | |||
| 18 | 30 | int main() { | |
| 19 | 30 | mint::set_mod(MOD); | |
| 20 | u32 t, mod, q; | ||
| 21 | 30 | tifa_libs::fin_uint >> t >> mod >> q; | |
| 22 | 30 | mint::set_mod(mod); | |
| 23 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 26 times.
|
30 | if (!q) { |
| 24 |
2/2✓ Branch 0 taken 3000007 times.
✓ Branch 1 taken 4 times.
|
3000011 | while (t--) { |
| 25 | i64 n, k; | ||
| 26 | 3000007 | tifa_libs::fin_uint >> n >> k; | |
| 27 |
3/4✓ Branch 0 taken 1916418 times.
✓ Branch 1 taken 1083589 times.
✓ Branch 2 taken 1916418 times.
✗ Branch 3 not taken.
|
3000007 | tifa_libs::fout << !(n < k || k < 0) << '\n'; |
| 28 | } | ||
| 29 | 4 | return 0; | |
| 30 | } | ||
| 31 | 26 | tifa_libs::qbinom<mint, fact_t> mCn(q); | |
| 32 |
2/2✓ Branch 0 taken 24000014 times.
✓ Branch 1 taken 26 times.
|
24000040 | while (t--) { |
| 33 | i64 n, k; | ||
| 34 | 24000014 | tifa_libs::fin_uint >> n >> k; | |
| 35 | 24000014 | tifa_libs::fout << mCn.qmCn(n, k) << '\n'; | |
| 36 | } | ||
| 37 | |||
| 38 | 26 | return 0; | |
| 39 | 26 | } | |
| 40 |