Skip to content

Commit 2222e9d

Browse files
lrvideckisweb-flow
andauthored
Golf idea (#185)
* Update kd_bit.hpp * [auto-verifier] verify commit 2ce8903 --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 8135aed commit 2222e9d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.verify-helper/timestamps.remote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"tests/library_checker_aizu_tests/data_structures/dsu_restorable.test.cpp": "2026-01-18 02:20:40 +0000",
2424
"tests/library_checker_aizu_tests/data_structures/dsu_segtree_undo_trick.test.cpp": "2026-01-23 04:31:29 +0000",
2525
"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2026-01-18 11:15:41 +0000",
26-
"tests/library_checker_aizu_tests/data_structures/kd_bit_1d.test.cpp": "2026-02-19 13:06:00 -0600",
26+
"tests/library_checker_aizu_tests/data_structures/kd_bit_1d.test.cpp": "2026-02-19 14:00:15 -0700",
2727
"tests/library_checker_aizu_tests/data_structures/kruskal_tree_aizu.test.cpp": "2026-01-18 02:20:40 +0000",
2828
"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2026-01-18 11:15:41 +0000",
2929
"tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp": "2026-02-04 02:50:53 +0000",
@@ -77,7 +77,7 @@
7777
"tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2026-01-28 21:48:16 -0700",
7878
"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2025-08-06 16:18:37 -0600",
7979
"tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp": "2026-01-18 02:20:40 +0000",
80-
"tests/library_checker_aizu_tests/handmade_tests/kd_bit.test.cpp": "2026-02-19 13:06:00 -0600",
80+
"tests/library_checker_aizu_tests/handmade_tests/kd_bit.test.cpp": "2026-02-19 14:00:15 -0700",
8181
"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2026-01-18 11:15:41 +0000",
8282
"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2026-02-04 02:50:53 +0000",
8383
"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2025-02-10 14:50:36 -0700",

library/data_structures_[l,r)/bit_uncommon/kd_bit.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
//! @time O(n^k + q * log^k n)
1313
//! @space O(n^k)
1414
// NOLINTNEXTLINE(readability-identifier-naming)
15-
template<int K> struct KD_BIT;
16-
template<> struct KD_BIT<0> {
17-
ll s = 0;
18-
void update(ll v) { s += v; }
19-
ll query() { return s; }
20-
};
2115
template<int K> struct KD_BIT {
2216
vector<KD_BIT<K - 1>> s;
2317
template<class... A>
@@ -32,3 +26,8 @@ template<int K> struct KD_BIT {
3226
return ans;
3327
}
3428
};
29+
template<> struct KD_BIT<0> {
30+
ll s = 0;
31+
void update(ll v) { s += v; }
32+
ll query() { return s; }
33+
};

0 commit comments

Comments
 (0)