Skip to content

Commit b816b58

Browse files
committed
Formatting rule changed
1 parent 25f1415 commit b816b58

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ Except such snippets, the programs written by the owner of the repo is under the
3737
Settings of `clang-format`:
3838

3939
```
40-
{ BasedOnStyle: LLVM, IndentWidth: 4, AccessModifierOffset: -4, AllowShortBlocksOnASingleLine: true, AllowShortCaseLabelsOnASingleLine: true, AllowShortFunctionsOnASingleLine: All, AllowShortIfStatementsOnASingleLine: true, AllowShortLoopsOnASingleLine: true, AlwaysBreakBeforeMultilineStrings: false, AlwaysBreakTemplateDeclarations: false, ColumnLimit: 120 }
40+
{ BasedOnStyle: LLVM, IndentWidth: 4, AccessModifierOffset: -4, AllowShortBlocksOnASingleLine: true, AllowShortCaseLabelsOnASingleLine: true, AllowShortFunctionsOnASingleLine: All, AllowShortIfStatementsOnASingleLine: true, AllowShortLoopsOnASingleLine: true, AlwaysBreakBeforeMultilineStrings: false, AlwaysBreakTemplateDeclarations: false, ColumnLimit: 110 }
4141
```

tree/centroid_decomposition.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// CUT begin
77
/*
88
(Recursive) Centroid Decomposition
9-
Verification: Codeforces #190 Div.1 C <https://codeforces.com/contest/321/submission/59093583>
9+
Verification: Codeforces #190 Div.1 C https://codeforces.com/contest/321/submission/59093583
1010
1111
fix_root(int r): Build information of the tree which `r` belongs to.
1212
detect_centroid(int r): Enumerate centroid(s) of the tree which `r` belongs to.

tree/eulertour.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ struct PreorderEulerTour {
2020
subtree_end[now] = vis_order.size();
2121
}
2222
PreorderEulerTour() = default;
23-
PreorderEulerTour(const std::vector<std::vector<int>> &to, int root) : V(to.size()), root(root), edges(to) {
23+
PreorderEulerTour(const std::vector<std::vector<int>> &to, int root)
24+
: V(to.size()), root(root), edges(to) {
2425
assert(root >= 0 and root < V);
2526
subtree_begin.resize(V);
2627
subtree_end.resize(V);

tree/heavy_light_decomposition.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@
99

1010
// CUT begin
1111
// Heavy-Light Decomposition of trees
12-
// Based on <http://beet-aizu.hatenablog.com/entry/2017/12/12/235950>
12+
// Based on http://beet-aizu.hatenablog.com/entry/2017/12/12/235950
1313
struct HeavyLightDecomposition {
1414
int V;
1515
int k;
1616
int nb_heavy_path;
1717
std::vector<std::vector<int>> e;
18-
std::vector<int> par; // par[i] = parent of vertex i (Default: -1)
19-
std::vector<int> depth; // depth[i] = distance between root and vertex i
20-
std::vector<int> subtree_sz; // subtree_sz[i] = size of subtree whose root is i
21-
std::vector<int> heavy_child; // heavy_child[i] = child of vertex i on heavy path (Default: -1)
22-
std::vector<int> tree_id; // tree_id[i] = id of tree vertex i belongs to
18+
std::vector<int> par; // par[i] = parent of vertex i (Default: -1)
19+
std::vector<int> depth; // depth[i] = distance between root and vertex i
20+
std::vector<int> subtree_sz; // subtree_sz[i] = size of subtree whose root is i
21+
std::vector<int> heavy_child; // heavy_child[i] = child of vertex i on heavy path (Default: -1)
22+
std::vector<int> tree_id; // tree_id[i] = id of tree vertex i belongs to
2323
std::vector<int> aligned_id, aligned_id_inv; // aligned_id[i] = aligned id for vertex i (consecutive on heavy edges)
24-
std::vector<int> head; // head[i] = id of vertex on heavy path of vertex i, nearest to root
25-
std::vector<int> head_ids; // consist of head vertex id's
26-
std::vector<int> heavy_path_id; // heavy_path_id[i] = heavy_path_id for vertex [i]
24+
std::vector<int> head; // head[i] = id of vertex on heavy path of vertex i, nearest to root
25+
std::vector<int> head_ids; // consist of head vertex id's
26+
std::vector<int> heavy_path_id; // heavy_path_id[i] = heavy_path_id for vertex [i]
2727

28-
HeavyLightDecomposition(int sz = 0) : V(sz), k(0), nb_heavy_path(0), e(sz), par(sz), depth(sz), subtree_sz(sz), heavy_child(sz), tree_id(sz, -1), aligned_id(sz), aligned_id_inv(sz), head(sz), heavy_path_id(sz, -1) {}
28+
HeavyLightDecomposition(int sz = 0)
29+
: V(sz), k(0), nb_heavy_path(0), e(sz), par(sz), depth(sz), subtree_sz(sz), heavy_child(sz), tree_id(sz, -1), aligned_id(sz), aligned_id_inv(sz), head(sz), heavy_path_id(sz, -1) {}
2930
void add_edge(int u, int v) {
3031
e[u].emplace_back(v);
3132
e[v].emplace_back(u);

tree/tree_isomorphism.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ using namespace std;
99
// CUT begin
1010
// Tree isomorphism with hashing (ハッシュによる木の同型判定)
1111
// Dependence: ModInt or ModIntRuntime
12-
// Reference: <https://snuke.hatenablog.com/entry/2017/02/03/054210>
13-
// Verified: <https://atcoder.jp/contests/nikkei2019-2-final/submissions/9044698> (ModInt)
14-
// <https://atcoder.jp/contests/nikkei2019-2-final/submissions/9044745> (ModIntRuntime)
12+
// Reference: https://snuke.hatenablog.com/entry/2017/02/03/054210
13+
// Verified: https://atcoder.jp/contests/nikkei2019-2-final/submissions/9044698 (ModInt)
14+
// https://atcoder.jp/contests/nikkei2019-2-final/submissions/9044745 (ModIntRuntime)
1515
using mint = ModInt<1000000007>;
1616
// using mint = ModIntRuntime;
1717
// int ModIntRuntime::mod = 1000000007;
@@ -27,7 +27,7 @@ struct UndirectedTree {
2727
}
2828

2929
static uint64_t splitmix64(uint64_t x) {
30-
// <https://codeforces.com/blog/entry/62393> <http://xorshift.di.unimi.it/splitmix64.c>
30+
// https://codeforces.com/blog/entry/62393 http://xorshift.di.unimi.it/splitmix64.c
3131
x += 0x9e3779b97f4a7c15;
3232
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
3333
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
@@ -39,7 +39,9 @@ struct UndirectedTree {
3939
}
4040

4141
static void add_hash(DoubleHash &l, const DoubleHash &r) { l.first += r.first, l.second += r.second; }
42-
static DoubleHash subtract_hash(const DoubleHash &l, const DoubleHash &r) { return {l.first - r.first, l.second - r.second}; }
42+
static DoubleHash subtract_hash(const DoubleHash &l, const DoubleHash &r) {
43+
return {l.first - r.first, l.second - r.second};
44+
}
4345

4446
vector<DoubleHash> hash; // hash of the tree, each node regarded as root
4547
vector<DoubleHash> hash_subtree; // hash of the subtree

0 commit comments

Comments
 (0)