Skip to content

Commit 67a2178

Browse files
authored
[auto-verifier] docs commit d5e1333
1 parent a3c8408 commit 67a2178

23 files changed

+647
-399
lines changed

index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ data:
1212
- icon: ':heavy_check_mark:'
1313
path: weilycoder/ds/point_add_range_sum.hpp
1414
title: Point Add Range Sum using Fenwick Tree
15+
- icon: ':heavy_check_mark:'
16+
path: weilycoder/ds/segment_tree.hpp
17+
title: Segment Tree Data Structure
1518
- icon: ':heavy_check_mark:'
1619
path: weilycoder/ds/static_range_sum.hpp
1720
title: Static Range Sum using Prefix Sums
@@ -54,6 +57,9 @@ data:
5457
- icon: ':heavy_check_mark:'
5558
path: test/point_add_range_sum.test.cpp
5659
title: test/point_add_range_sum.test.cpp
60+
- icon: ':heavy_check_mark:'
61+
path: test/point_set_range_composite.test.cpp
62+
title: test/point_set_range_composite.test.cpp
5763
- icon: ':heavy_check_mark:'
5864
path: test/primality_test.test.cpp
5965
title: test/primality_test.test.cpp

test/aplusb.test.cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ data:
160160
isVerificationFile: true
161161
path: test/aplusb.test.cpp
162162
requiredBy: []
163-
timestamp: '2025-10-31 09:52:58+08:00'
163+
timestamp: '2025-11-01 07:16:21+08:00'
164164
verificationStatus: TEST_ACCEPTED
165165
verifiedWith: []
166166
documentation_of: test/aplusb.test.cpp

test/biconnected_components.test.cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ data:
112112
isVerificationFile: true
113113
path: test/biconnected_components.test.cpp
114114
requiredBy: []
115-
timestamp: '2025-10-31 09:52:58+08:00'
115+
timestamp: '2025-11-01 07:16:21+08:00'
116116
verificationStatus: TEST_ACCEPTED
117117
verifiedWith: []
118118
documentation_of: test/biconnected_components.test.cpp

test/many_aplusb.test.cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ data:
162162
isVerificationFile: true
163163
path: test/many_aplusb.test.cpp
164164
requiredBy: []
165-
timestamp: '2025-10-31 09:52:58+08:00'
165+
timestamp: '2025-11-01 07:16:21+08:00'
166166
verificationStatus: TEST_ACCEPTED
167167
verifiedWith: []
168168
documentation_of: test/many_aplusb.test.cpp

test/many_aplusb_128bit.test.cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ data:
161161
isVerificationFile: true
162162
path: test/many_aplusb_128bit.test.cpp
163163
requiredBy: []
164-
timestamp: '2025-10-31 09:52:58+08:00'
164+
timestamp: '2025-11-01 07:16:21+08:00'
165165
verificationStatus: TEST_ACCEPTED
166166
verifiedWith: []
167167
documentation_of: test/many_aplusb_128bit.test.cpp

test/point_add_range_sum.test.cpp.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,40 @@ data:
1818
links:
1919
- https://judge.yosupo.jp/problem/point_add_range_sum
2020
bundledCode: "#line 1 \"test/point_add_range_sum.test.cpp\"\n#define PROBLEM \"\
21-
https://judge.yosupo.jp/problem/point_add_range_sum\"\n\n#line 1 \"weilycoder/ds/point_add_range_sum.hpp\"\
22-
\n\n\n\n/**\n * @file point_add_range_sum.hpp\n * @brief Point Add Range Sum using\
23-
\ Fenwick Tree\n */\n\n#line 1 \"weilycoder/ds/group.hpp\"\n\n\n\n/**\n * @file\
24-
\ group.hpp\n * @brief Group Definitions\n */\n\n#include <limits>\n\nnamespace\
25-
\ weilycoder {\n/**\n * @brief Additive Group\n * @tparam T Type of the elements\n\
26-
\ */\ntemplate <typename T> struct AddGroup {\n using value_type = T;\n static\
27-
\ constexpr T operation(const T &a, const T &b) { return a + b; }\n static constexpr\
28-
\ T identity() { return T{}; }\n static constexpr T inverse(const T &a) { return\
29-
\ -a; }\n};\n\n/**\n * @brief Additive Monoid\n * @tparam T Type of the elements\n\
30-
\ */\ntemplate <typename T> struct AddMonoid {\n using value_type = T;\n static\
31-
\ constexpr T operation(const T &a, const T &b) { return a + b; }\n static constexpr\
32-
\ T identity() { return T{}; }\n};\n\n/**\n * @brief Minimum Monoid for numbers\n\
33-
\ * @tparam T Type of the elements, must support std::numeric_limits\n */\ntemplate\
34-
\ <typename T> struct NumberMinMonoid {\n using value_type = T;\n static constexpr\
35-
\ T operation(const T &a, const T &b) { return a < b ? a : b; }\n static constexpr\
36-
\ T identity() { return std::numeric_limits<T>::max(); }\n};\n\n/**\n * @brief\
37-
\ Maximum Monoid for numbers\n * @tparam T Type of the elements, must support\
38-
\ std::numeric_limits\n */\ntemplate <typename T> struct NumberMaxMonoid {\n \
39-
\ using value_type = T;\n static constexpr T operation(const T &a, const T &b)\
40-
\ { return a > b ? a : b; }\n static constexpr T identity() { return std::numeric_limits<T>::min();\
41-
\ }\n};\n} // namespace weilycoder\n\n\n#line 10 \"weilycoder/ds/point_add_range_sum.hpp\"\
42-
\n#include <cstddef>\n#include <stdexcept>\n#include <vector>\n\nnamespace weilycoder\
43-
\ {\n/**\n * @brief Point Add Range Sum using Fenwick Tree (Binary Indexed Tree)\n\
44-
\ * @tparam Group A group defining the operation and identity element,\n * \
45-
\ must be associative and commutative (i.e. Abelian group).\n */\n\
46-
template <typename Group> struct PointAddRangeSum {\n using value_type = typename\
47-
\ Group::value_type;\n using T = value_type;\n\nprivate:\n std::vector<T> data;\n\
48-
\npublic:\n /**\n * @brief Constructs a PointAddRangeSum for n elements initialized\
49-
\ to the\n * identity element\n * @param n Number of elements\n */\n\
50-
\ explicit PointAddRangeSum(size_t n) : data(n + 1, Group::identity()) {}\n\n\
51-
\ /**\n * @brief Constructs a PointAddRangeSum from an initial array\n *\
52-
\ @param initial Initial array of elements\n */\n explicit PointAddRangeSum(const\
53-
\ std::vector<T> &initial)\n : data(initial.size() + 1, Group::identity())\
54-
\ {\n for (size_t i = 1; i <= initial.size(); ++i) {\n data[i] = Group::operation(data[i],\
21+
https://judge.yosupo.jp/problem/point_add_range_sum\"\n\n#line 1 \"weilycoder/ds/group.hpp\"\
22+
\n\n\n\n/**\n * @file group.hpp\n * @brief Group Definitions\n */\n\n#include\
23+
\ <limits>\n\nnamespace weilycoder {\n/**\n * @brief Additive Group\n * @tparam\
24+
\ T Type of the elements\n */\ntemplate <typename T> struct AddGroup {\n using\
25+
\ value_type = T;\n static constexpr T operation(const T &a, const T &b) { return\
26+
\ a + b; }\n static constexpr T identity() { return T{}; }\n static constexpr\
27+
\ T inverse(const T &a) { return -a; }\n};\n\n/**\n * @brief Additive Monoid\n\
28+
\ * @tparam T Type of the elements\n */\ntemplate <typename T> struct AddMonoid\
29+
\ {\n using value_type = T;\n static constexpr T operation(const T &a, const\
30+
\ T &b) { return a + b; }\n static constexpr T identity() { return T{}; }\n};\n\
31+
\n/**\n * @brief Minimum Monoid for numbers\n * @tparam T Type of the elements,\
32+
\ must support std::numeric_limits\n */\ntemplate <typename T> struct NumberMinMonoid\
33+
\ {\n using value_type = T;\n static constexpr T operation(const T &a, const\
34+
\ T &b) { return a < b ? a : b; }\n static constexpr T identity() { return std::numeric_limits<T>::max();\
35+
\ }\n};\n\n/**\n * @brief Maximum Monoid for numbers\n * @tparam T Type of the\
36+
\ elements, must support std::numeric_limits\n */\ntemplate <typename T> struct\
37+
\ NumberMaxMonoid {\n using value_type = T;\n static constexpr T operation(const\
38+
\ T &a, const T &b) { return a > b ? a : b; }\n static constexpr T identity()\
39+
\ { return std::numeric_limits<T>::min(); }\n};\n} // namespace weilycoder\n\n\
40+
\n#line 1 \"weilycoder/ds/point_add_range_sum.hpp\"\n\n\n\n/**\n * @file point_add_range_sum.hpp\n\
41+
\ * @brief Point Add Range Sum using Fenwick Tree\n */\n\n#include <cstddef>\n\
42+
#include <stdexcept>\n#include <vector>\n\nnamespace weilycoder {\n/**\n * @brief\
43+
\ Point Add Range Sum using Fenwick Tree (Binary Indexed Tree)\n * @tparam Group\
44+
\ A group defining the operation and identity element,\n * must\
45+
\ be associative and commutative (i.e. Abelian group).\n */\ntemplate <typename\
46+
\ Group> struct PointAddRangeSum {\n using value_type = typename Group::value_type;\n\
47+
\ using T = value_type;\n\nprivate:\n std::vector<T> data;\n\npublic:\n /**\n\
48+
\ * @brief Constructs a PointAddRangeSum for n elements initialized to the\n\
49+
\ * identity element\n * @param n Number of elements\n */\n explicit\
50+
\ PointAddRangeSum(size_t n) : data(n + 1, Group::identity()) {}\n\n /**\n \
51+
\ * @brief Constructs a PointAddRangeSum from an initial array\n * @param initial\
52+
\ Initial array of elements\n */\n explicit PointAddRangeSum(const std::vector<T>\
53+
\ &initial)\n : data(initial.size() + 1, Group::identity()) {\n for (size_t\
54+
\ i = 1; i <= initial.size(); ++i) {\n data[i] = Group::operation(data[i],\
5555
\ initial[i - 1]);\n size_t j = i + (i & -i);\n if (j < data.size())\n\
5656
\ data[j] = Group::operation(data[j], data[i]);\n }\n }\n\n /**\n\
5757
\ * @brief Constructs a PointAddRangeSum from an initial range\n * @tparam\
@@ -76,8 +76,8 @@ data:
7676
\ T range_sum(size_t l, size_t r) const {\n if (l > r || r > size())\n \
7777
\ throw std::out_of_range(\"Invalid range for range_sum\");\n return Group::operation(prefix_sum(r),\
7878
\ Group::inverse(prefix_sum(l)));\n }\n};\n} // namespace weilycoder\n\n\n#line\
79-
\ 4 \"test/point_add_range_sum.test.cpp\"\n#include <cstdint>\n#include <iostream>\n\
80-
#line 7 \"test/point_add_range_sum.test.cpp\"\nusing namespace std;\nusing namespace\
79+
\ 5 \"test/point_add_range_sum.test.cpp\"\n#include <cstdint>\n#include <iostream>\n\
80+
#line 8 \"test/point_add_range_sum.test.cpp\"\nusing namespace std;\nusing namespace\
8181
\ weilycoder;\n\nint main() {\n cin.tie(nullptr)->sync_with_stdio(false);\n \
8282
\ cin.exceptions(cin.failbit | cin.badbit);\n size_t n, q;\n cin >> n >> q;\n\
8383
\n vector<uint64_t> initial(n, 0);\n for (size_t i = 0; i < n; ++i)\n cin\
@@ -87,23 +87,23 @@ data:
8787
\ size_t l, r;\n cin >> l >> r;\n cout << pasr.range_sum(l, r) <<\
8888
\ '\\n';\n }\n }\n return 0;\n}\n"
8989
code: "#define PROBLEM \"https://judge.yosupo.jp/problem/point_add_range_sum\"\n\
90-
\n#include \"../weilycoder/ds/point_add_range_sum.hpp\"\n#include <cstdint>\n\
91-
#include <iostream>\n#include <vector>\nusing namespace std;\nusing namespace\
92-
\ weilycoder;\n\nint main() {\n cin.tie(nullptr)->sync_with_stdio(false);\n \
93-
\ cin.exceptions(cin.failbit | cin.badbit);\n size_t n, q;\n cin >> n >> q;\n\
90+
\n#include \"../weilycoder/ds/group.hpp\"\n#include \"../weilycoder/ds/point_add_range_sum.hpp\"\
91+
\n#include <cstdint>\n#include <iostream>\n#include <vector>\nusing namespace\
92+
\ std;\nusing namespace weilycoder;\n\nint main() {\n cin.tie(nullptr)->sync_with_stdio(false);\n\
93+
\ cin.exceptions(cin.failbit | cin.badbit);\n size_t n, q;\n cin >> n >> q;\n\
9494
\n vector<uint64_t> initial(n, 0);\n for (size_t i = 0; i < n; ++i)\n cin\
9595
\ >> initial[i];\n\n PointAddRangeSum<AddGroup<uint64_t>> pasr(initial);\n while\
9696
\ (q--) {\n int type;\n cin >> type;\n if (type == 0) {\n size_t\
9797
\ i, x;\n cin >> i >> x;\n pasr.point_add(i, x);\n } else {\n \
9898
\ size_t l, r;\n cin >> l >> r;\n cout << pasr.range_sum(l, r) <<\
9999
\ '\\n';\n }\n }\n return 0;\n}"
100100
dependsOn:
101-
- weilycoder/ds/point_add_range_sum.hpp
102101
- weilycoder/ds/group.hpp
102+
- weilycoder/ds/point_add_range_sum.hpp
103103
isVerificationFile: true
104104
path: test/point_add_range_sum.test.cpp
105105
requiredBy: []
106-
timestamp: '2025-10-31 09:52:58+08:00'
106+
timestamp: '2025-11-01 07:16:21+08:00'
107107
verificationStatus: TEST_ACCEPTED
108108
verifiedWith: []
109109
documentation_of: test/point_add_range_sum.test.cpp

0 commit comments

Comments
 (0)