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
2 changes: 1 addition & 1 deletion library/dsu/line_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct line_tree {
vi p, last;
vector<pii> edge;
line_tree(int n): p(n, -1), last(n), edge(n, {-1, -1}) {
iota(all(last), 0);
ranges::iota(last, 0);
}
int size(int u) { return -p[f(u)]; }
int f(int u) { return p[u] < 0 ? u : p[u] = f(p[u]); }
Expand Down
2 changes: 1 addition & 1 deletion library/graphs/mst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pair<ll, vi> mst(const vector<array<int, 3>>& w_eds,
int n) {
vi order(sz(w_eds));
iota(all(order), 0);
ranges::iota(order, 0);
ranges::sort(order, {},
[&](int i) { return w_eds[i][2]; });
DSU dsu(n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ vi offline_incremental_scc(vector<array<int, 2>> eds,
int n) {
int m = sz(eds);
vi ids(n, -1), joins(m, m), idx(m), vs(n), scc_id;
iota(all(idx), 0);
ranges::iota(idx, 0);
vector<vi> g;
auto dnc = [&](this auto&& dnc, auto el, auto er, int tl,
int tr) {
Expand Down
2 changes: 1 addition & 1 deletion library/graphs/uncommon/complement_graph_ccs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
vi get_complement_graph_ccs(const auto& g) {
int n = sz(g);
vi cc_id(n), unseen(n);
iota(all(unseen), 0);
ranges::iota(unseen, 0);
vector<bool> is_g(n);
for (int cnt = 0; !empty(unseen); cnt++) {
int s = unseen.back();
Expand Down
2 changes: 1 addition & 1 deletion library/math/prime_sieve/calc_linear_sieve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! @time O(mx)
//! @space O(mx)
vi primes, sieve(1001); //!< min prime factor
iota(all(sieve), 0);
ranges::iota(sieve, 0);
rep(i, 2, sz(sieve)) {
if (sieve[i] == i) primes.push_back(i);
for (int prime : primes) {
Expand Down
2 changes: 1 addition & 1 deletion library/math/prime_sieve/calc_sieve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! @time O(mx * log(log mx))
//! @space O(mx)
vi sieve(1001); //!< min prime factor
iota(all(sieve), 0);
ranges::iota(sieve, 0);
for (int i = 2; i * i < sz(sieve); i++)
if (sieve[i] == i)
for (int j = i * i; j < sz(sieve); j += i)
Expand Down
2 changes: 1 addition & 1 deletion library/strings/longest_common_subsequence/lcs_dp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
template<class T> struct lcs_dp {
T t;
vi dp;
lcs_dp(const T& t): t(t), dp(sz(t)) { iota(all(dp), 0); }
lcs_dp(const T& t): t(t), dp(sz(t)) { ranges::iota(dp, 0); }
void push_onto_s(int c) {
int v = -1;
rep(i, 0, sz(t)) if (c == t[i] || dp[i] < v)
Expand Down
2 changes: 1 addition & 1 deletion library/strings/manacher/longest_palindrome_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct longest_pal_query {
//! @space O(n log n) for rmq, everything else is O(n)
longest_pal_query(const auto& s): man(manacher(s)) {
vi init(sz(man));
iota(all(init), 0);
ranges::iota(init, 0);
rmq = {init, [&](int i1, int i2) {
return len(i1) < len(i2) ? i2 : i1;
}};
Expand Down
4 changes: 2 additions & 2 deletions library/strings/suffix_array/suffix_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
auto get_sa(const auto& s, int max_num) {
int n = sz(s);
vi sa(n), sa_inv(all(s)), lcp(n - 1);
iota(all(sa), 0);
ranges::iota(sa, 0);
for (int i = 0; i < n; i = max(1, 2 * i)) {
vi y(sa_inv), freq(max_num);
iota(all(sa_inv), n - i);
ranges::iota(sa_inv, n - i);
ranges::copy_if(sa, begin(sa_inv) + i,
[&](int& x) { return (x -= i) >= 0; });
for (int x : y) freq[x]++;
Expand Down
2 changes: 1 addition & 1 deletion library/strings/suffix_array/suffix_array_short.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
auto sa_short(const auto& s) {
int n = sz(s), b = 6;
vi sa(n), sa_inv(all(s)), lcp(n - 1), t(n);
iota(all(sa), 0);
ranges::iota(sa, 0);
for (int j = 1; j <= n; j *= b) {
swap(t, sa_inv);
auto cmp = [&](int i1, int i2) {
Expand Down
4 changes: 2 additions & 2 deletions library/trees/edge_cd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ template<class G> void edge_cd(vector<G>& g, auto f) {
if (m < 2) return;
u = ctd(u, u, m);
int sum = 0;
auto it = partition(all(g[u]), [&](int v) {
auto it = begin(ranges::partition(g[u], [&](int v) {
ll x = sum + s[v];
return x * x < m * (m - x) ? sum = x : 0;
});
}));
f(u, it - begin(g[u]));
G oth(it, end(g[u]));
g[u].erase(it, end(g[u]));
Expand Down
2 changes: 1 addition & 1 deletion library/trees/extra_members/virtual_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ array<vi, 2> compress_tree(vi subset) {
rep(i, 1, len)
subset.push_back(lca(subset[i - 1], subset[i]));
ranges::sort(subset, {}, proj);
subset.erase(unique(all(subset)), end(subset));
subset.erase(begin(ranges::unique(subset)), end(subset));
return {
mono_st(subset,
[&](int u, int v) { return in_subtree(u, v); }),
Expand Down
Loading