test/cpv/library-checker-datastructure/static_range_sum.fenwick.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/static_range_sum | ||
| 2 | #include "../../../src/ds/fenwick/d1/lib.hpp" | ||
| 3 | |||
| 4 | using namespace tifa_libs; | ||
| 5 | 11 | int main() { | |
| 6 |
1/2✓ Branch 2 taken 11 times.
✗ Branch 3 not taken.
|
11 | std::cin.tie(nullptr)->std::ios::sync_with_stdio(false); |
| 7 | u32 n, q; | ||
| 8 |
2/4✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 11 times.
✗ Branch 5 not taken.
|
11 | std::cin >> n >> q; |
| 9 |
1/2✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
|
11 | vecuu a(n + 1); |
| 10 |
3/4✓ Branch 2 taken 4112461 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4112461 times.
✓ Branch 5 taken 11 times.
|
4112472 | flt_ (u32, i, 1, n + 1) std::cin >> a[i]; |
| 11 | 11 | fenwick<u64> f(a); | |
| 12 |
2/2✓ Branch 0 taken 3831138 times.
✓ Branch 1 taken 11 times.
|
3831149 | flt_ (u32, i, 1, q + 1) { |
| 13 | u32 l, r; | ||
| 14 |
2/4✓ Branch 1 taken 3831138 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3831138 times.
✗ Branch 5 not taken.
|
3831138 | std::cin >> l >> r; |
| 15 |
2/4✓ Branch 3 taken 3831138 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 3831138 times.
✗ Branch 7 not taken.
|
3831138 | std::cout << f.sum(r) - f.sum(l) << '\n'; |
| 16 | } | ||
| 17 | 11 | return 0; | |
| 18 | 11 | } | |
| 19 |