Skip to content

Commit 1d523b9

Browse files
authored
Each example init own block (#118)
* update script * remove numbers in commented examples * some fixes * final touch
1 parent 1e59c9e commit 1d523b9

36 files changed

+76
-59
lines changed

library/data_structures/deque_op/queue_only.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
//! https://github.com/suisen-cp/cp-library-cpp/blob/main/library/datastructure/deque_aggregation.hpp
33
//! @code
4-
//! deq dq(a, [](auto x, auto y) {return min(x, y);});
4+
//! deq dq(a, ranges::min);
55
//! @endcode
66
//! @time operations are O(1) ammortized
77
//! @space O(n)

library/data_structures/rmq_inc.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#pragma once
22
//! @code
3-
//! rmq_inc rmq3(a, ranges::min);
4-
//! rmq_inc rmq4(a, [&](auto& x, auto& y) {
3+
//! rmq_inc rmq1(a, ranges::min);
4+
//! rmq_inc rmq2(a, [&](auto& x, auto& y) {
55
//! return min(x, y);
66
//! });
77
//! vector<rmq_inc<int, function<int(int, int)>>>
8-
//! rmqs2(3, {{}, NULL});
9-
//! rmqs2[1] = {a, ranges::min};
8+
//! rmqs(3, {{}, NULL});
9+
//! rmqs[1] = {a, ranges::min};
1010
//! @endcode
1111
//! @time O(nlogn + q)
1212
//! @space O(nlogn)

library/data_structures/seg_tree.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
//! https://github.com/kth-competitive-programming/kactl/blob/main/content/data-structures/SegmentTree.h
33
//! @code
4-
//! tree st0(n, INT_MAX, ranges::min);
5-
//! tree st(n, INT_MAX, [&](int x, int y) -> int {
4+
//! tree st1(n, INT_MAX, ranges::min);
5+
//! tree st2(n, INT_MAX, [&](int x, int y) -> int {
66
//! return min(x, y);
77
//! });
88
//! @endcode

library/data_structures/seg_tree_inc.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#pragma once
22
//! https://codeforces.com/blog/entry/118682
33
//! @code
4-
//! tree_inc st3(n, int{}, ranges::min);
5-
//! tree_inc st4(n, pii{}, [&](pii x, pii y) -> pii {
6-
//! return min(x, y);
7-
//! });
8-
//! rep(i, 0, n) st3.update(i, a[i]);
4+
//! tree_inc st(n, int{}, ranges::min);
5+
//! rep(i, 0, n) st.update(i, a[i]);
96
//! @endcode
107
//! @time O(n + q log n)
118
//! @space O(n)

library/data_structures/seg_tree_uncommon/find_first.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
//! @code
3-
//! seg_tree st1(n);
4-
//! st1.find_first(l, r, [&](ll x, int tl, int tr) ->
3+
//! seg_tree st(n);
4+
//! st.find_first(l, r, [&](ll x, int tl, int tr) ->
55
//! bool {
66
//! });
77
//! @endcode

library/data_structures/seg_tree_uncommon/find_last.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
//! @code
3-
//! seg_tree st2(n);
4-
//! st2.find_last(l, r, [&](ll x, int tl, int tr) ->
3+
//! seg_tree st(n);
4+
//! st.find_last(l, r, [&](ll x, int tl, int tr) ->
55
//! bool {
66
//! });
77
//! @endcode

library/data_structures/uncommon/disjoint_rmq.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Disjoint RMQ is like normal RMQ except
44
//! the 2 query ranges never overlap.
55
//! @code
6-
//! disjoint_rmq dis_rmq1(a, [&](int x, int y) {
6+
//! disjoint_rmq rmq(a, [&](int x, int y) {
77
//! return 1LL*x*y%10;
88
//! });
99
//! @endcode

library/data_structures/uncommon/disjoint_rmq_inc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Disjoint RMQ is like normal RMQ except
44
//! the 2 query ranges never overlap.
55
//! @code
6-
//! disjoint_rmq dis_rmq2(a, [&](int x, int y) {
6+
//! disjoint_rmq rmq(a, [&](int x, int y) {
77
//! return 1LL*x*y%10;
88
//! });
99
//! @endcode

library/data_structures/uncommon/linear_rmq.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#pragma once
22
//! https://codeforces.com/blog/entry/125371?#comment-1173604
33
//! @code
4-
//! linear_rmq lr1(a, less());//right-most min
5-
//! linear_rmq lr2(a, less_equal());//left-most min
6-
//! linear_rmq lr3(a, greater());//right-most max
7-
//! linear_rmq lr4(a, greater_equal());//left-most max
8-
//! linear_rmq lr5(a, [&](auto& x, auto& y) {
4+
//! linear_rmq rmq1(a, less());//right-most min
5+
//! linear_rmq rmq2(a, less_equal());//left-most min
6+
//! linear_rmq rmq3(a, greater());//right-most max
7+
//! linear_rmq rmq4(a, greater_equal());//left-most max
8+
//! linear_rmq rmq5(a, [&](auto& x, auto& y) {
99
//! return x < y;
1010
//! });
1111
//! @endcode

library/graphs/bridges_cuts/block_vertex_tree.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#pragma once
22
#include "cuts.hpp"
33
//! @code
4-
//! cuts cc(adj_c, m);
5-
//! vector<vi> bvt = block_vertex_tree(adj_c, cc);
4+
//! vector<vector<pii>> adj(n);
5+
//! cuts cc(adj, m);
6+
//! vector<vi> bvt = block_vertex_tree(adj, cc);
67
//! //to loop over each unique bcc containing a node u:
78
//! for (int bccid : bvt[v]) {
89
//! bccid -= n;

0 commit comments

Comments
 (0)