Skip to content

Commit 41443c0

Browse files
committed
update format
1 parent 473177a commit 41443c0

60 files changed

Lines changed: 159 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

library/data_structures_[l,r)/seg_tree_uncommon/find_first.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ int find_first_in_range(int l, int r, auto f, int tl,
4242
if (r <= tl || tr <= l) return r;
4343
if (l <= tl && tr <= r)
4444
return f(tree[v], tl, tr)
45-
? find_first_in_subtree(f, tl, tr, v)
46-
: r;
45+
? find_first_in_subtree(f, tl, tr, v)
46+
: r;
4747
int tm = split(tl, tr);
4848
push(tl, tm, tr, v);
4949
int res = find_first_in_range(l, r, f, tl, tm, 2 * v);

library/data_structures_[l,r)/seg_tree_uncommon/find_last.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ int find_last_in_range(int l, int r, auto f, int tl,
4242
if (r <= tl || tr <= l) return l - 1;
4343
if (l <= tl && tr <= r)
4444
return f(tree[v], tl, tr)
45-
? find_last_in_subtree(f, tl, tr, v)
46-
: l - 1;
45+
? find_last_in_subtree(f, tl, tr, v)
46+
: l - 1;
4747
int tm = split(tl, tr);
4848
push(tl, tm, tr, v);
4949
int res = find_last_in_range(l, r, f, tm, tr, 2 * v + 1);

library/data_structures_[l,r)/seg_tree_uncommon/kth_smallest_query.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct kth_smallest {
2727
if (tr - tl == 1) return tl;
2828
int tm = tl + (tr - tl) / 2;
2929
int left_count = pst.tree[pst.tree[vr].lch].sum -
30-
pst.tree[pst.tree[vl].lch].sum;
30+
pst.tree[pst.tree[vl].lch].sum;
3131
if (left_count >= k)
3232
return query(k, tl, tm, pst.tree[vl].lch,
3333
pst.tree[vr].lch);

library/data_structures_[l,r)/seg_tree_uncommon/merge_sort_tree.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ struct merge_sort_tree {
2121
if (r <= tl || tr <= l) return 0;
2222
if (l <= tl && tr <= r)
2323
return ranges::lower_bound(tree[v], vr) -
24-
ranges::lower_bound(tree[v], vl);
24+
ranges::lower_bound(tree[v], vl);
2525
int tm = split(tl, tr);
2626
return query(l, r, vl, vr, tl, tm, 2 * v) +
27-
query(l, r, vl, vr, tm, tr, 2 * v + 1);
27+
query(l, r, vl, vr, tm, tr, 2 * v + 1);
2828
}
2929
};

library/data_structures_[l,r)/seg_tree_uncommon/persistent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ struct PST {
4747
if (l <= tl && tr <= r) return tree[v].sum;
4848
int tm = tl + (tr - tl) / 2;
4949
return query(l, r, tl, tm, tree[v].lch) +
50-
query(l, r, tm, tr, tree[v].rch);
50+
query(l, r, tm, tr, tree[v].rch);
5151
}
5252
};

library/data_structures_[l,r)/uncommon/mode_query.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ struct mode_query {
5353
for (int i = l / b * b + b - 1; i >= l; i--) {
5454
int idx = index_into_index[i];
5555
if (idx + res.second < sz(index[a[i]]) &&
56-
index[a[i]][idx + res.second] < r)
56+
index[a[i]][idx + res.second] < r)
5757
res = {a[i], cnt[a[i]] + res.second};
5858
cnt[a[i]]--;
5959
}
6060
rep(i, (r - 1) / b * b, r) cnt[a[i]]++;
6161
rep(i, (r - 1) / b * b, r) {
6262
int idx = index_into_index[i];
6363
if (idx >= res.second &&
64-
index[a[i]][idx - res.second] >= l)
64+
index[a[i]][idx - res.second] >= l)
6565
res = {a[i], cnt[a[i]] + res.second};
6666
cnt[a[i]]--;
6767
}

library/data_structures_[l,r)/uncommon/permutation_tree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct perm_tree {
2020
vector<vi> ch;
2121
bool touches(int u, int v) {
2222
return p[u].mn_num == p[v].mn_num + p[v].len ||
23-
p[v].mn_num == p[u].mn_num + p[u].len;
23+
p[v].mn_num == p[u].mn_num + p[u].len;
2424
}
2525
int allocate(int mn_i, int mn_v, int ln, bool join,
2626
const vi& chs) {

library/data_structures_[l,r]/linear_rmq.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ template<class T, class F> struct linear_rmq {
2323
rep(i, 0, n + 1) {
2424
int prev = 0;
2525
while (sz(st) > 1 &&
26-
(i == n || !cmp(a[st.back()], a[i]))) {
26+
(i == n || !cmp(a[st.back()], a[i]))) {
2727
head[prev] = st.back();
2828
auto j = end(st)[-2] + 1u, k = bit_floor(i ^ j);
2929
in[st.back()] = prev = i & -k, asc[j] |= k;
3030
st.pop_back();
3131
}
3232
st.push_back(head[prev] = i);
3333
}
34-
rep(i, 1, n) asc[i] =
35-
(asc[i] | asc[i - 1]) & -(in[i] & -in[i]);
34+
rep(i, 1, n)
35+
asc[i] = (asc[i] | asc[i - 1]) & -(in[i] & -in[i]);
3636
}
3737
int idx(int l, int r) {
3838
if (unsigned j = in[l] ^ in[r]) {

library/graphs/hopcroft_karp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct hopcroft_karp {
4747
for (int v : g[u]) {
4848
int w = to_l[v];
4949
if (w == -1 ||
50-
(level[u] + 1 == level[w] && dfs(dfs, w))) {
50+
(level[u] + 1 == level[w] && dfs(dfs, w))) {
5151
to_r[u] = v;
5252
to_l[v] = u;
5353
return 1;
@@ -56,8 +56,8 @@ struct hopcroft_karp {
5656
level[u] = INT_MAX;
5757
return 0;
5858
};
59-
rep(i, 0, lsz) m_sz +=
60-
(to_r[i] == -1 && dfs(dfs, i));
59+
rep(i, 0, lsz)
60+
m_sz += (to_r[i] == -1 && dfs(dfs, i));
6161
}
6262
}
6363
};

library/math/count_paths/count_paths_rectangle.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ array<vl, 2> get_right_and_top(vl left, vl bottom) {
2424
rep(i, 0, sz(dp)) dp[i] =
2525
bottom[i] * t[sz(dp) - 1 - i].inv_fact % mod;
2626
vl tmp_res = conv(dp, tr);
27-
rep(i, 0, sz(res)) res[i] =
28-
(res[i] +
29-
tmp_res[i + sz(bottom) - 1] * t[i].inv_fact) %
30-
mod;
27+
rep(i, 0, sz(res))
28+
res[i] = (res[i] + tmp_res[i + sz(bottom) - 1] *
29+
t[i].inv_fact) %
30+
mod;
3131
}
3232
swap(left, bottom);
3333
}

0 commit comments

Comments
 (0)