Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/graphs/dijkstra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! auto d = dijkstra(g, source);
//! @endcode
//! d[v] = min dist from source->..->v
//! requires weights >= 0
//! @time O(n + (m log m))
//! @space O(n + m)
vector<ll> dijkstra(const auto& g, int s) {
Expand Down
1 change: 1 addition & 0 deletions library/graphs/uncommon/enumerate_triangles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! //u, v, w form a triangle
//! });
//! @endcode
//! requires no self loops or multi edges
//! @time O(n + m ^ (3/2))
//! @space O(n + m)
void enumerate_triangles(const vector<pii>& edges, int n,
Expand Down
1 change: 1 addition & 0 deletions library/loops/submasks.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
//! loops over submasks in decreasing order
//! excludes the empty submask
//! @param mask a submask of 2^n-1
//! @time O(3^n) to iterate every submask
//! of every mask of size n
Expand Down
1 change: 1 addition & 0 deletions library/math/derangements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! auto der = derangements(n, mod);
//! @endcode
//! der[i] = number of permutations p with p[i]!=i
//! requires n >= 1
//! @time O(n)
//! @space O(n)
vector<ll> derangements(int n, int mod) {
Expand Down
1 change: 1 addition & 0 deletions library/math/matrix_related/matrix_mult.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
//! https://codeforces.com/blog/entry/80195
//! watch for overflow if T is an integer type
//! @time O(n * m * inner)
//! @space O(n * m)
template<class T>
Expand Down
1 change: 1 addition & 0 deletions library/math/matrix_related/row_reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! columns [0,cols) of mat represent a matrix
//! columns [cols,m) of mat are also
//! affected by row operations
//! requires mod is prime
//! @time O(n * m * min(cols, n))
//! @space O(1)
pii row_reduce(vector<vi>& mat, int cols) {
Expand Down
1 change: 1 addition & 0 deletions library/math/mod_division.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! @code
//! int quotient = mod_div(x, y); // returns x * y^-1
//! @endcode
//! requires gcd(y, mod) == 1
//! @time O(log(y))
//! @space O(1)
const int mod = 998244353;
Expand Down
2 changes: 2 additions & 0 deletions library/strings/binary_trie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//! bt.update(num, 1); // insert
//! bt.update(num, -1); // erase
//! @endcode
//! requires 0 <= num < 2^61
//! walk requires a non-empty trie
//! @time O(q * mx_bit)
//! @space O(q * mx_bit)
const ll mx_bit = 1LL << 60;
Expand Down
1 change: 1 addition & 0 deletions library/strings/kmp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//! auto match2 = kmp1.find_str(s_vec);
//! @endcode
//! if match[i] == 1 then s[i,ssize(t)) == t
//! requires t non-empty
//! @time O(|s| + |t|)
//! @space O(|s| + |t|)
// NOLINTNEXTLINE(readability-identifier-naming)
Expand Down
1 change: 1 addition & 0 deletions library/trees/centroid_decomp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! vector<basic_string<int>> g(n);
//! vector<int> p = cd(g, [&](int c) {});
//! @endcode
//! g is mutated (edges removed)
//! @time O(n log n)
//! @space O(n)
vi cd(auto& g, auto f) {
Expand Down
1 change: 1 addition & 0 deletions library/trees/edge_cd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! });
//! @endcode
//! handle single-edge-paths separately
//! g is mutated (edges reordered/removed)
//! @time O(n logφ n)
//! @space O(n)
template<class G> void edge_cd(vector<G>& g, auto f) {
Expand Down
1 change: 1 addition & 0 deletions library/trees/hld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! });
//! auto [l, r] = hld.subtree(u); // [l, r)
//! @endcode
//! g is mutated (parent edges removed)
//! @time O(n + q log^2 n)
//! @space O(n)
// NOLINTNEXTLINE(readability-identifier-naming)
Expand Down
4 changes: 2 additions & 2 deletions tests/.config/.cppcheck_suppression_list
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ arrayIndexOutOfBoundsCond:library_checker_aizu_tests/math/linear_prime_sieve.tes
negativeContainerIndex:../library/strings/suffix_array/burrows_wheeler.hpp:50
useStlAlgorithm:../kactl/content/numerical/FastFourierTransform.h:53
useStlAlgorithm:../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp:58
useStlAlgorithm:../library/math/matrix_related/row_reduce.hpp:28
useStlAlgorithm:../library/math/matrix_related/row_reduce.hpp:29
useStlAlgorithm:../library/math/count_paths/count_paths_triangle.hpp:25
useStlAlgorithm:../library/math/matrix_related/xor_basis_unordered.hpp:14
shadowFunction:../kactl/content/graph/BinaryLifting.h:17
Expand All @@ -35,7 +35,7 @@ syntaxError:../library/math/prime_sieve/calc_sieve.hpp:6
syntaxError:../library/math/prime_sieve/calc_linear_sieve.hpp:6
syntaxError:../library/loops/chooses.hpp:7
syntaxError:../library/loops/quotients.hpp:10
syntaxError:../library/loops/submasks.hpp:7
syntaxError:../library/loops/submasks.hpp:8
syntaxError:../library/loops/supermasks.hpp:8
syntaxError:../library/math/prime_sieve/mobius.hpp:6
syntaxError:../library/trees/lca_rmq/iterate_subtree.hpp:6
Expand Down
Loading