test/cpv/library-checker-datastructure/range_chmin_chmax_add_range_sum.segbeats_ca_ms.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/range_chmin_chmax_add_range_sum | ||
| 2 | #include "../../../src/ds/segtree/segbeats_ca_ms/lib.hpp" | ||
| 3 | #include "../../../src/io/fastin/lib.hpp" | ||
| 4 | #include "../../../src/io/fastout/lib.hpp" | ||
| 5 | #include "../../../src/io/i128/lib.hpp" | ||
| 6 | |||
| 7 | using namespace tifa_libs; | ||
| 8 | 33 | int main() { | |
| 9 | u32 n, q; | ||
| 10 | 33 | fin_uint >> n >> q; | |
| 11 |
1/2✓ Branch 1 taken 33 times.
✗ Branch 2 not taken.
|
33 | vecii a(n); |
| 12 |
2/2✓ Branch 6 taken 3252405 times.
✓ Branch 7 taken 33 times.
|
3252438 | for (auto& i : a) fin_int >> i; |
| 13 | 33 | segbeats_ca_ms<i64, i128> seg(a); | |
| 14 |
2/2✓ Branch 0 taken 3439686 times.
✓ Branch 1 taken 33 times.
|
3439719 | for (u32 i = 0, opt, l, r; i < q; ++i) { |
| 15 | 3439686 | fin_uint >> opt >> l >> r; | |
| 16 |
2/2✓ Branch 0 taken 568140 times.
✓ Branch 1 taken 2871546 times.
|
3439686 | if (opt == 3) fout << seg.query_sum(l, r) << '\n'; |
| 17 | else { | ||
| 18 | i64 b; | ||
| 19 | 2871546 | fin_int >> b; | |
| 20 |
2/2✓ Branch 0 taken 1165612 times.
✓ Branch 1 taken 1705934 times.
|
2871546 | if (opt == 0) seg.chmin(l, r, b); |
| 21 |
2/2✓ Branch 0 taken 1013438 times.
✓ Branch 1 taken 692496 times.
|
1705934 | else if (opt == 1) seg.chmax(l, r, b); |
| 22 | 692496 | else seg.add(l, r, b); | |
| 23 | } | ||
| 24 | } | ||
| 25 | 33 | return 0; | |
| 26 | 33 | } | |
| 27 |