Skip to content

Commit 056c373

Browse files
lrvideckisweb-flow
andauthored
ten second time limit (#117)
* rerun tests with lower time limit * [auto-verifier] verify commit a8eafec * split up rmq test * fix this test * fix * tiny speedup * remove cuz it's too slow * speed up test * also use std::midpoint * decrease * decrease * decrease bound * actually revert this * [auto-verifier] verify commit 6056884 * fix * fix * [auto-verifier] verify commit ddee6c9 * update * remove test * fix * add justification * actually 10 seconds * [auto-verifier] verify commit aef5803 * split up tests * shorten other test * move speed test to edge CD * add assert for par of centroid tree * [auto-verifier] verify commit f5ff9d2 * remove cd asserts * add cd asserts here at least * speedup * [auto-verifier] verify commit eeb24af * remove var * trying some optimizations * Revert "trying some optimizations" This reverts commit 5540481. * [auto-verifier] verify commit 5540481 * [auto-verifier] verify commit 0ed6e32 * seeing if iterative scc is any faster * Revert "seeing if iterative scc is any faster" This reverts commit b461c40. * [auto-verifier] verify commit 83a7e02 * trying this speedup * [auto-verifier] verify commit 8218b94 * fix format * revert * [auto-verifier] verify commit 359e1a9 * format * rename folder * fail on path not found here * fix * remove slow test LOL * another fix * [auto-verifier] verify commit 1aa118b * speedup * [auto-verifier] verify commit 65b45ca * trying this * actually it doesn't work now * fix --------- Co-authored-by: GitHub <noreply@github.com>
1 parent 94f95ce commit 056c373

39 files changed

Lines changed: 222 additions & 393 deletions

.github/workflows/programming_team_code_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Run tests
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: oj-verify all --tle 35 --timeout 21600
30+
run: oj-verify all --tle 10 --timeout 21600
3131

3232
check_format_lint:
3333
runs-on: ubuntu-latest

.verify-helper/timestamps.remote.json

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"tests/library_checker_aizu_tests/data_structures/binary_trie.test.cpp": "2024-11-17 14:04:03 -0600",
77
"tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2024-12-14 19:50:29 -0600",
88
"tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2024-11-18 09:44:22 -0600",
9-
"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2024-11-18 09:44:22 -0600",
9+
"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2024-12-10 11:52:04 -0600",
1010
"tests/library_checker_aizu_tests/data_structures/bit_rupq.test.cpp": "2024-12-05 10:41:42 -0600",
1111
"tests/library_checker_aizu_tests/data_structures/bit_rurq.test.cpp": "2024-12-05 10:41:42 -0600",
1212
"tests/library_checker_aizu_tests/data_structures/bit_walk.test.cpp": "2024-12-14 19:50:29 -0600",
@@ -21,7 +21,7 @@
2121
"tests/library_checker_aizu_tests/data_structures/dsu_bipartite.test.cpp": "2024-12-14 19:50:29 -0600",
2222
"tests/library_checker_aizu_tests/data_structures/dsu_restorable.test.cpp": "2024-11-17 14:04:03 -0600",
2323
"tests/library_checker_aizu_tests/data_structures/dsu_segtree_undo_trick.test.cpp": "2024-12-14 19:50:29 -0600",
24-
"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2024-11-17 14:04:03 -0600",
24+
"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2024-12-15 09:29:23 -0600",
2525
"tests/library_checker_aizu_tests/data_structures/kruskal_tree_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
2626
"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2024-12-05 10:41:42 -0600",
2727
"tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp": "2024-11-19 08:31:51 -0600",
@@ -38,40 +38,41 @@
3838
"tests/library_checker_aizu_tests/data_structures/persistent_seg_tree.test.cpp": "2024-12-05 10:41:42 -0600",
3939
"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_sliding_window.test.cpp": "2024-12-05 10:41:42 -0600",
4040
"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_with_dsu.test.cpp": "2024-12-05 10:41:42 -0600",
41-
"tests/library_checker_aizu_tests/data_structures/range_parallel_dsu.test.cpp": "2024-12-14 19:50:29 -0600",
42-
"tests/library_checker_aizu_tests/data_structures/rmq_all_methods.test.cpp": "2024-12-14 19:50:29 -0600",
43-
"tests/library_checker_aizu_tests/data_structures/rmq_inc.test.cpp": "2024-12-14 15:47:13 -0600",
41+
"tests/library_checker_aizu_tests/data_structures/range_parallel_dsu.test.cpp": "2024-12-15 12:37:34 -0600",
42+
"tests/library_checker_aizu_tests/data_structures/rmq_disjoint_sparse_table.test.cpp": "2024-12-15 09:26:21 -0600",
43+
"tests/library_checker_aizu_tests/data_structures/rmq_linear.test.cpp": "2024-12-15 12:37:34 -0600",
44+
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2024-12-15 12:37:34 -0600",
45+
"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2024-12-15 09:26:21 -0600",
4446
"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2024-12-14 15:47:13 -0600",
4547
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2024-12-14 15:47:13 -0600",
4648
"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2024-12-14 15:47:13 -0600",
4749
"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2024-12-14 15:47:13 -0600",
4850
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
49-
"tests/library_checker_aizu_tests/flow/dinic_lib_checker.test.cpp": "2024-11-17 14:04:03 -0600",
5051
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",
5152
"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600",
5253
"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2024-12-15 09:01:54 -0600",
5354
"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600",
5455
"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
5556
"tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
56-
"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2024-12-15 09:01:54 -0600",
57+
"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2024-12-15 12:40:15 -0600",
5758
"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2024-12-14 19:50:29 -0600",
5859
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
5960
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
6061
"tests/library_checker_aizu_tests/graphs/mst.test.cpp": "2024-11-17 14:04:03 -0600",
61-
"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2024-12-15 09:01:54 -0600",
62-
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2024-12-15 09:01:54 -0600",
63-
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2024-12-15 09:01:54 -0600",
62+
"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2024-12-15 12:40:15 -0600",
63+
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2024-12-15 12:40:15 -0600",
64+
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2024-12-15 12:40:15 -0600",
6465
"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2024-12-15 09:01:54 -0600",
65-
"tests/library_checker_aizu_tests/handmade_tests/count_paths_forest.test.cpp": "2024-12-14 19:50:29 -0600",
66+
"tests/library_checker_aizu_tests/handmade_tests/count_paths_forest.test.cpp": "2024-12-15 12:37:34 -0600",
6667
"tests/library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp": "2024-12-14 19:50:29 -0600",
6768
"tests/library_checker_aizu_tests/handmade_tests/dynamic_bitset.test.cpp": "2024-11-22 10:47:44 -0600",
68-
"tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2024-12-14 18:43:21 -0600",
69+
"tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2024-12-15 12:37:34 -0600",
6970
"tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2024-12-14 19:50:29 -0600",
70-
"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2024-12-14 19:50:29 -0600",
71+
"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2024-12-15 12:37:34 -0600",
7172
"tests/library_checker_aizu_tests/handmade_tests/lca_ladder_forest.test.cpp": "2024-12-14 19:50:29 -0600",
7273
"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2024-12-14 19:50:29 -0600",
7374
"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2024-12-14 19:50:29 -0600",
74-
"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2024-11-17 14:04:03 -0600",
75+
"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2024-12-10 12:31:07 -0600",
7576
"tests/library_checker_aizu_tests/handmade_tests/mod_int.test.cpp": "2024-12-14 19:50:29 -0600",
7677
"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2024-12-14 19:50:29 -0600",
7778
"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2024-12-14 15:47:13 -0600",
@@ -85,7 +86,7 @@
8586
"tests/library_checker_aizu_tests/loops/supermasks.test.cpp": "2024-11-17 14:04:03 -0600",
8687
"tests/library_checker_aizu_tests/math/binary_exponentiation_mod.test.cpp": "2024-11-17 14:04:03 -0600",
8788
"tests/library_checker_aizu_tests/math/binary_matrix_mult.test.cpp": "2024-11-17 14:04:03 -0600",
88-
"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2024-11-17 14:04:03 -0600",
89+
"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2024-12-15 12:37:34 -0600",
8990
"tests/library_checker_aizu_tests/math/derangement.test.cpp": "2024-11-17 14:04:03 -0600",
9091
"tests/library_checker_aizu_tests/math/matrix_determinant.test.cpp": "2024-12-14 15:47:13 -0600",
9192
"tests/library_checker_aizu_tests/math/matrix_mult.test.cpp": "2024-11-17 14:04:03 -0600",
@@ -100,40 +101,38 @@
100101
"tests/library_checker_aizu_tests/math/solve_linear_mod.test.cpp": "2024-12-14 15:47:13 -0600",
101102
"tests/library_checker_aizu_tests/math/tetration.test.cpp": "2024-11-17 14:04:03 -0600",
102103
"tests/library_checker_aizu_tests/math/totient.test.cpp": "2024-11-17 14:04:03 -0600",
103-
"tests/library_checker_aizu_tests/math/xor_basis.test.cpp": "2024-12-14 15:47:13 -0600",
104-
"tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp": "2024-12-14 15:47:13 -0600",
104+
"tests/library_checker_aizu_tests/math/xor_basis.test.cpp": "2024-12-15 13:39:10 -0600",
105+
"tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp": "2024-12-15 13:39:10 -0600",
105106
"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_binary_tree.test.cpp": "2024-12-14 19:50:29 -0600",
106-
"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_k_ary_tree.test.cpp": "2024-12-14 19:50:29 -0600",
107-
"tests/library_checker_aizu_tests/monotonic_stack_related/count_rectangles.test.cpp": "2024-12-14 19:50:29 -0600",
108-
"tests/library_checker_aizu_tests/monotonic_stack_related/max_rect_histogram.test.cpp": "2024-12-14 19:50:29 -0600",
107+
"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_k_ary_tree.test.cpp": "2024-12-15 12:37:34 -0600",
108+
"tests/library_checker_aizu_tests/monotonic_stack_related/count_rectangles.test.cpp": "2024-12-15 12:37:34 -0600",
109+
"tests/library_checker_aizu_tests/monotonic_stack_related/max_rect_histogram.test.cpp": "2024-12-15 12:37:34 -0600",
109110
"tests/library_checker_aizu_tests/strings/kmp.test.cpp": "2024-12-14 19:50:29 -0600",
110111
"tests/library_checker_aizu_tests/strings/lcp_array.test.cpp": "2024-12-14 19:50:29 -0600",
111112
"tests/library_checker_aizu_tests/strings/lcp_query_palindrome.test.cpp": "2024-12-14 19:50:29 -0600",
112113
"tests/library_checker_aizu_tests/strings/lcp_query_zfunc.test.cpp": "2024-12-14 19:50:29 -0600",
113114
"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2024-12-05 10:41:42 -0600",
114115
"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2024-12-14 19:50:29 -0600",
115116
"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2024-12-05 10:41:42 -0600",
116-
"tests/library_checker_aizu_tests/strings/longest_common_substring.test.cpp": "2024-12-14 19:50:29 -0600",
117117
"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2024-12-14 19:50:29 -0600",
118118
"tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2024-12-14 19:50:29 -0600",
119119
"tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2024-12-14 19:50:29 -0600",
120120
"tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2024-12-14 19:50:29 -0600",
121121
"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2024-12-14 19:50:29 -0600",
122122
"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2024-12-14 19:50:29 -0600",
123-
"tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2024-12-14 19:50:29 -0600",
123+
"tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2024-12-15 12:37:34 -0600",
124124
"tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2024-12-14 19:50:29 -0600",
125125
"tests/library_checker_aizu_tests/strings/trie.test.cpp": "2024-12-05 10:41:42 -0600",
126126
"tests/library_checker_aizu_tests/strings/wildcard_pattern_matching.test.cpp": "2024-12-14 19:50:29 -0600",
127-
"tests/library_checker_aizu_tests/trees/cd_jump_on_tree.test.cpp": "2024-12-14 18:43:21 -0600",
128-
"tests/library_checker_aizu_tests/trees/cd_lca.test.cpp": "2024-12-14 18:43:21 -0600",
129-
"tests/library_checker_aizu_tests/trees/count_paths_per_length.test.cpp": "2024-12-14 19:50:29 -0600",
127+
"tests/library_checker_aizu_tests/trees/count_paths_per_length.test.cpp": "2024-12-15 12:37:34 -0600",
130128
"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_query.test.cpp": "2024-12-14 18:43:21 -0600",
131129
"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_update.test.cpp": "2024-12-14 18:43:21 -0600",
132130
"tests/library_checker_aizu_tests/trees/edge_cd_count_paths_per_length.test.cpp": "2024-12-14 18:43:21 -0600",
133131
"tests/library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp": "2024-12-14 18:43:21 -0600",
134-
"tests/library_checker_aizu_tests/trees/kth_node_on_path.test.cpp": "2024-12-14 19:50:29 -0600",
135-
"tests/library_checker_aizu_tests/trees/ladder_decomposition.test.cpp": "2024-12-14 19:50:29 -0600",
132+
"tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2024-12-15 09:26:21 -0600",
133+
"tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2024-12-15 09:26:21 -0600",
134+
"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2024-12-15 12:37:34 -0600",
136135
"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
137136
"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
138-
"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2024-12-14 19:50:29 -0600"
137+
"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2024-12-15 12:37:34 -0600"
139138
}

library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp renamed to library/graphs/scc/add_edges_strongly_connected.hpp

File renamed without changes.

library/graphs/strongly_connected_components/offline_incremental_scc.hpp renamed to library/graphs/scc/offline_incremental_scc.hpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
vi offline_incremental_scc(vector<array<int, 2>> eds,
1414
int n) {
1515
int m = sz(eds);
16-
vi ids(n, -1), joins(m, m), idx(m);
16+
vi ids(n, -1), joins(m, m), idx(m), vs(n), scc_id;
1717
iota(all(idx), 0);
18+
vector<basic_string<int>> adj;
1819
auto divide_and_conquer = [&](auto&& self, auto el,
1920
auto er, int tl, int tr) {
20-
int mid = tl + (tr - tl) / 2;
21-
vi vs;
22-
vector<vi> adj;
21+
adj.clear();
22+
int mid = midpoint(tl, tr);
2323
for (auto it = el; it != er; it++) {
2424
auto& [u, v] = eds[*it];
2525
for (int w : {u, v}) {
2626
if (ids[w] != -1) continue;
27-
ids[w] = sz(vs);
28-
vs.push_back(w);
27+
ids[w] = sz(adj);
28+
vs[sz(adj)] = w;
2929
adj.emplace_back();
3030
}
3131
u = ids[u], v = ids[v];
3232
if (*it <= mid) adj[u].push_back(v);
3333
}
34-
for (int v : vs) ids[v] = -1;
35-
auto scc_id = sccs(adj).second;
34+
rep(i, 0, sz(adj)) ids[vs[i]] = -1;
35+
scc_id = sccs(adj).second;
3636
auto split = partition(el, er, [&](int i) {
3737
return scc_id[eds[i][0]] == scc_id[eds[i][1]];
3838
});
@@ -42,10 +42,6 @@ vi offline_incremental_scc(vector<array<int, 2>> eds,
4242
auto& [u, v] = eds[*it];
4343
u = scc_id[u], v = scc_id[v];
4444
}
45-
// deallocate to avoid O(m log m) memory
46-
vi().swap(vs);
47-
vector<vi>().swap(adj);
48-
vi().swap(scc_id);
4945
self(self, el, split, tl, mid);
5046
self(self, split, er, mid, tr);
5147
};

library/graphs/strongly_connected_components/scc.hpp renamed to library/graphs/scc/scc.hpp

File renamed without changes.

library/math/count_paths/count_paths_triangle.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
vl divide_and_conquer(vl h, vl bottom) {
77
{
88
int start =
9-
find_if(all(h), [](ll x) { return x; }) - begin(h);
9+
ranges::find_if(h, [](ll x) { return x; }) -
10+
begin(h);
1011
h.erase(begin(h), begin(h) + start);
1112
bottom.erase(begin(bottom), begin(bottom) + start);
1213
}

library/math/matrix_related/xor_basis_unordered.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
//! @code
55
//! basis<int> b1;
66
//! basis<ll> b2;
7-
//! basis<dynamic_bitset<>> b3;
87
//! @endcode
98
//! b.shrink(v) == b.shrink(b.shrink(v))
109
//! for x in b.b: (bit_floor(x)&b.shrink(v))==0
1110
//! for 0<=i<j<sz(b.b): (bit_floor(b[i])&b[j])==0
1211
//! @time O(32) or O(64)
1312
//! @space O(32) or O(64)
1413
template<class T> struct basis {
15-
vector<T> b;
14+
basic_string<T> b;
1615
T shrink(T v) {
1716
for (T x : b) v = min(v, v ^ x);
1817
return v;

library/math/matrix_related/xor_basis_unordered_intersection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
template<class T>
77
basis<T> intersection(const basis<T>& u,
88
const basis<T>& v) {
9-
vector<array<T, 2>> w(sz(u.b));
10-
rep(i, 0, sz(w)) w[i] = {u.b[i], u.b[i]};
9+
basic_string<array<T, 2>> w;
10+
for (T e : u.b) w.push_back({e, e});
1111
basis<T> res;
1212
for (T e : v.b) {
1313
T s = 0;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
//! @time O(mx log mx)
33
//! @space O(mx)
4-
vi mobius(1'000'005);
4+
vi mobius(100'005);
55
mobius[1] = 1;
66
rep(i, 1, sz(mobius)) for (int j = i + i; j < sz(mobius);
77
j += i) mobius[j] -= mobius[i];

library/trees/centroid_decomp_uncommon/count_paths_per_length.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ vector<ll> count_paths_per_length(const vector<vi>& adj) {
2828
swap(q, new_q);
2929
}
3030
}
31-
ranges::sort(child_depths,
32-
[&](auto& x, auto& y) { return sz(x) < sz(y); });
31+
ranges::sort(child_depths, {},
32+
[&](auto& x) { return sz(x); });
3333
vector total_depth(1, 1.0);
3434
for (auto& cnt_depth : child_depths) {
3535
auto prod = conv(total_depth, cnt_depth);

0 commit comments

Comments
 (0)