Skip to content
88 changes: 44 additions & 44 deletions .verify-helper/timestamps.remote.json

Large diffs are not rendered by default.

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 @@ -38,10 +38,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 @@ -14,7 +14,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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {
compress.push_back(x);
}
ranges::sort(compress);
compress.erase(unique(all(compress)), end(compress));
compress.erase(begin(ranges::unique(compress)), end(compress));
BIT bit(sz(compress));
auto get_compressed_idx = [&](int val) -> int {
int l = 0, r = sz(compress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main() {
rep(i, 0, n) cin >> arr[i];
vi sorted(arr);
ranges::sort(sorted);
sorted.erase(unique(all(sorted)), end(sorted));
sorted.erase(begin(ranges::unique(sorted)), end(sorted));
for (int& val : arr) {
int start = 0, end = sz(sorted);
while (start + 1 < end) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main() {
rep(i, 0, n) cin >> a[i];
vi comp(a);
ranges::sort(comp);
comp.erase(unique(all(comp)), end(comp));
comp.erase(begin(ranges::unique(comp)), end(comp));
for (int& val : a) {
int start = 0, end = sz(comp);
while (start + 1 < end) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {
rep(t, 0, m)
assert((eds[t][0] == eds[t][1]) == (joins[t] == -1));
vi order(m);
iota(all(order), 0);
ranges::iota(order, 0);
ranges::sort(order, {}, [&](int i) { return joins[i]; });
DSU dsu(n);
int sum = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
for (int n = 1; n <= 8; n++) {
vi a(n);
iota(all(a), 0);
ranges::iota(a, 0);
do {
perm_tree pt = perm_tree_asserts(a);
} while (next_permutation(all(a)));
} while (ranges::next_permutation(a).found);
}
cout << "Hello World\n";
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
for (int n = 1; n <= 8; n++) {
vi perm(n);
iota(all(perm), 0);
ranges::iota(perm, 0);
do {
test_all_subarrays(perm);
} while (next_permutation(all(perm)));
} while (ranges::next_permutation(perm).found);
}
for (int n = 1; n <= 100; n++) {
rep(times, 0, 40) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main() {
else assert(cur_le == prv_ri);
}
ranges::sort(rngs);
assert(unique(all(rngs)) == end(rngs));
assert(begin(ranges::unique(rngs)) == end(rngs));
reset();
assert(
pos == rv(rev.find_last(rv(r - 1), rv(l) + 1, f)));
Expand All @@ -67,7 +67,7 @@ int main() {
else assert(prv_le == cur_ri);
}
ranges::sort(rngs);
assert(unique(all(rngs)) == end(rngs));
assert(begin(ranges::unique(rngs)) == end(rngs));
}
cout << "Hello World\n";
return 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/library_checker_aizu_tests/mono_st_asserts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tuple<int, vector<vi>, vi> min_cartesian_tree(const vi& a,
return r[i] == n || a[r[i]] < a[i];
};
vi to_min(n);
iota(all(to_min), 0);
ranges::iota(to_min, 0);
for (int i = n - 1; i >= 0; i--)
if (!is_node(i)) to_min[i] = to_min[r[i]];
vector<vi> adj(n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main() {
for (int& x : arr) cin >> x;
vi compress(arr);
ranges::sort(compress);
compress.erase(unique(all(compress)), end(compress));
compress.erase(begin(ranges::unique(compress)), end(compress));
for (int& x : arr) {
int l = -1, r = int(sz(compress));
while (r - l > 1) {
Expand All @@ -24,7 +24,7 @@ int main() {
auto [sa, sa_inv, lcp] = get_sa(arr, int(sz(compress)));
sa_query lq(arr, sa, sa_inv, lcp);
vi idxs(n);
iota(all(idxs), 0);
ranges::iota(idxs, 0);
ranges::sort(idxs, [&](int i, int j) -> bool {
return lq.cmp_substrs(2 * i, 2 * (i + 1), 2 * j,
2 * (j + 1)) < 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ int main() {
vi matches_other(begin(lq_both.sa) + sa_le2,
begin(lq_both.sa) + sa_ri2);
matches_other.erase(
remove_if(all(matches_other),
[&](int val) { return val >= sz(s) + 1; }),
begin(ranges::remove_if(matches_other,
[&](int val) { return val >= sz(s) + 1; })),
end(matches_other));
ranges::sort(matches_other);
assert(matches == matches_other);
Expand Down