test/cpv/library-checker-linear_algebra/matrix_det_arbitrary_mod.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/matrix_det_arbitrary_mod | ||
| 2 | #include "../../../src/lalg/ds/mat/lib.hpp" | ||
| 3 | #include "../../../src/lalg/mat/det/lib.hpp" | ||
| 4 | #include "../../../src/lalg/mat/ge/lib.hpp" | ||
| 5 | #include "../../../src/math/ds/mint/md/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | using mint = mint_md<__LINE__>; | ||
| 9 | using mat = matrix<mint>; | ||
| 10 | |||
| 11 | 20 | int main() { | |
| 12 |
1/2✓ Branch 2 taken 20 times.
✗ Branch 3 not taken.
|
20 | std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); |
| 13 | u32 n, MOD; | ||
| 14 |
2/4✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 20 times.
✗ Branch 5 not taken.
|
20 | std::cin >> n >> MOD; |
| 15 | 20 | mint::set_mod(MOD); | |
| 16 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 19 times.
|
20 | if (!n) { |
| 17 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | std::cout << "1\n"; |
| 18 | 1 | return 0; | |
| 19 | } | ||
| 20 | 19 | mat a(n, n); | |
| 21 | 19 | std::cin >> a; | |
| 22 | 3334396 | auto is_0 = [](cT_(mint) x) { return x.val() == 0; }; | |
| 23 | 19 | auto ge = [&is_0](mat& m, bool f) { return ge_mat<mint, decltype(is_0), true>(m, is_0, f); }; | |
| 24 |
1/2✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
|
19 | std::cout << det(a, ge); |
| 25 | 19 | return 0; | |
| 26 | 19 | } | |
| 27 |