GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 91.3% 21 / 0 / 23
Functions: 50.0% 2 / 0 / 4
Branches: 62.5% 15 / 0 / 24

test/cpv/library-checker-datastructure/point_set_range_composite.mints-ms64.cpp
Line Branch Exec Source
1 #define AUTO_GENERATED
2 // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/point_set_range_composite
3 #include "../../../src/ds/segtree/hp/lib.hpp"
4
5 using namespace tifa_libs;
6 CEXP u32 MOD = 998244353;
7
8 #include "../../../src/math/ds/mint/ms64/lib.hpp"
9
10 using namespace tifa_libs;
11 using mint = mint_ms64<MOD>;
12 using Ty = mint;
13 using T = std::pair<Ty, Ty>;
14 using F = T;
15
16 74036823 auto op(T a, T b) { // b(a(x))
17 74036823 std::swap(a, b);
18 74036823 return T{a.first * b.first, a.first * b.second + a.second};
19 }
20 void mapping(T& a, F f) { a = op(f, a); }
21 void composition(F& x, F) { x = F(1, 0); }
22
23 16 int main() {
24
1/2
✓ Branch 2 taken 16 times.
✗ Branch 3 not taken.
16 std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
25 u32 n, q;
26
2/4
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 16 times.
✗ Branch 5 not taken.
16 std::cin >> n >> q;
27
1/2
✓ Branch 1 taken 16 times.
✗ Branch 2 not taken.
16 vec<T> a(n);
28
2/2
✓ Branch 7 taken 4112476 times.
✓ Branch 8 taken 16 times.
4112492 for (auto& x : a) std::cin >> x.first >> x.second;
29 16 tifa_libs::segtree<T, op, F, mapping, composition> seg({1, 0}, {1, 0}, a);
30
2/2
✓ Branch 0 taken 3836138 times.
✓ Branch 1 taken 16 times.
3836154 for (u32 i = 0, opt; i < q; ++i) {
31
1/2
✓ Branch 1 taken 3836138 times.
✗ Branch 2 not taken.
3836138 std::cin >> opt;
32
2/2
✓ Branch 0 taken 1916669 times.
✓ Branch 1 taken 1919469 times.
3836138 if (opt == 0) {
33 u32 x;
34 1916669 Ty y, z;
35
1/2
✓ Branch 1 taken 1916669 times.
✗ Branch 2 not taken.
1916669 std::cin >> x >> y >> z;
36 1916669 seg.set(x, T{y, z});
37 } else {
38 u32 x, y;
39 1919469 Ty z;
40
2/4
✓ Branch 1 taken 1919469 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1919469 times.
✗ Branch 5 not taken.
1919469 std::cin >> x >> y >> z;
41 1919469 auto ret = seg.query(x, y);
42
1/2
✓ Branch 4 taken 1919469 times.
✗ Branch 5 not taken.
1919469 std::cout << ret.first * z + ret.second << '\n';
43 }
44 }
45 16 return 0;
46 16 }
47