test/cpv_local/nt/lsieve2.loj124.s30.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: LOCALCASE test/cpv_local/_data/loj/124 | ||
| 2 | |||
| 3 | #include "../../../src/math/ds/mint/ms/lib.hpp" | ||
| 4 | #include "../../../src/math/qpow/basic/lib.hpp" | ||
| 5 | #include "../../../src/nt/lsieve/impl2/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | using std::cin, std::cout; | ||
| 9 | using mint = mint_ms<1'000'000'000 + 7>; | ||
| 10 | |||
| 11 | 25 | int main() { | |
| 12 | u32 n, k; | ||
| 13 |
2/4✓ Branch 1 taken 25 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 25 times.
✗ Branch 5 not taken.
|
25 | cin >> n >> k; |
| 14 | 25 | lsieve2 ls(n); | |
| 15 | 25 | mint pk = 1, lst = 1; | |
| 16 | 25 | vec<mint> dk = ls.template run<mint>([&](u32 p, u32 e) { | |
| 17 |
2/2✓ Branch 0 taken 9896659 times.
✓ Branch 1 taken 10749 times.
|
9907408 | if (e == 1) pk = qpow<mint>(p, k), lst = 1 + pk; |
| 18 | 10749 | else lst = lst * pk + 1; | |
| 19 | 9907408 | return lst; | |
| 20 | 25 | }); | |
| 21 | 25 | mint res = 0; | |
| 22 |
2/2✓ Branch 2 taken 145238581 times.
✓ Branch 3 taken 25 times.
|
145238606 | flt_ (u32, i, 1, n + 1) res += dk[i]; |
| 23 |
2/4✓ Branch 2 taken 25 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 25 times.
✗ Branch 6 not taken.
|
25 | cout << res.val() << '\n'; |
| 24 | 25 | } | |
| 25 |