From f27b52f183f083876df382c4bc1b4ff400458520 Mon Sep 17 00:00:00 2001 From: NyaanNyaan Date: Sat, 14 Sep 2024 20:40:02 +0900 Subject: [PATCH 1/8] add misc --- data-structure/parallel-union-find.hpp | 21 +++++ math/enumerate-convex.hpp | 86 ++++++++++++++++++ math/{sum-of-floor.hpp => floor-sum.hpp} | 2 - math/gaussian-integer.hpp | 57 ++++++++++++ math/two-square.hpp | 91 +++++++++++++++++++ misc/doubling.hpp | 30 +++--- misc/mo-fast.hpp | 5 +- modint/adjunction-modint.hpp | 43 +++++++++ .../sum-of-multiplicative-function.hpp | 82 +++++++++++------ segment-tree/lazy-segment-tree-utility.hpp | 29 +++--- segment-tree/rbst-segment-tree.hpp | 16 ++-- string/number-of-subsequences.hpp | 17 ++++ string/run-enumerate.hpp | 72 +++++++++++++++ string/z-algorithm.hpp | 14 +-- .../enumerate-convex.test.cpp | 59 ++++++++++++ verify/verify-unit-test/math.test.cpp | 2 +- verify/verify-unit-test/sum-of-mf.test.cpp | 12 ++- .../yosupo-range-parallel-unionfind.test.cpp | 38 ++++++++ .../yosupo-gcd-of-gaussian-integer.test.cpp | 19 ++++ .../yosupo-sum-of-floor.test.cpp | 2 +- .../yosupo-two-square-sum.test.cpp | 19 ++++ .../yosupo-number-of-subsequences.test.cpp | 28 ++++++ .../yosupo-run-enumerate.test.cpp | 19 ++++ .../yosupo-wildcard-pattern-matching.test.cpp | 19 ++++ verify/verify-yuki/yuki-2883.test.cpp | 44 +++++++++ 25 files changed, 744 insertions(+), 82 deletions(-) create mode 100644 math/enumerate-convex.hpp rename math/{sum-of-floor.hpp => floor-sum.hpp} (99%) create mode 100644 math/gaussian-integer.hpp create mode 100644 math/two-square.hpp create mode 100644 modint/adjunction-modint.hpp create mode 100644 string/number-of-subsequences.hpp create mode 100644 string/run-enumerate.hpp create mode 100644 verify/verify-unit-test/enumerate-convex.test.cpp create mode 100644 verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp create mode 100644 verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp create mode 100644 verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp create mode 100644 verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp create mode 100644 verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp create mode 100644 verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp create mode 100644 verify/verify-yuki/yuki-2883.test.cpp diff --git a/data-structure/parallel-union-find.hpp b/data-structure/parallel-union-find.hpp index 51e4a5f2e..7c750f841 100644 --- a/data-structure/parallel-union-find.hpp +++ b/data-structure/parallel-union-find.hpp @@ -31,6 +31,27 @@ struct ParallelUnionFind { }); } } + // [l1, r1) と [l2, r2) を unite する + // f(x, y) : x に y をマージ + template + void unite(int l1, int r1, int l2, int r2, const F& f) { + assert(0 <= l1 and l1 <= r1 and r1 <= n); + assert(0 <= l2 and l2 <= r2 and r2 <= n); + assert(r1 - l1 == r2 - l2); + while (1) { + if (seg.same(l1, r1, l2, r2)) break; + int ok = 0, ng = r1 - l1; + while (ok + 1 < ng) { + int m = (ok + ng) / 2; + (seg.same(l1, l1 + m, l2, l2 + m) ? ok : ng) = m; + } + uf.unite(l1 + ok, l2 + ok, [&](int x, int y) { + for (int z : uf.enumerate(y)) seg.update(z, x); + f(x, y); + }); + } + } + void unite(int l, int r) { unite(l, l + 1, r, r + 1); } int find(int i) { return uf.find(i); } int same(int l, int r) { return uf.same(l, r); } diff --git a/math/enumerate-convex.hpp b/math/enumerate-convex.hpp new file mode 100644 index 000000000..12717ecce --- /dev/null +++ b/math/enumerate-convex.hpp @@ -0,0 +1,86 @@ +#pragma once + +#include +#include +#include +using namespace std; + +#include "stern-brocot-tree.hpp" + +// 下向き凸包の頂点列挙 +// (xl, yl) 始点, x in [xl, xr] +// inside(x, y) : (x, y) が凸包内部か? +// candicate(x, y, c, d) : (x, y) が凸包外部にあるとする。 +// 凸包内部の点 (x + sc, y + sd) が存在すればそのような s を返す +// 存在しなければ任意の値 (-1 でもよい) を返す +template +vector> enumerate_convex( + Int xl, Int yl, Int xr, const function& inside, + const function& candicate) { + assert(xl <= xr); + + // inside かつ x <= xr + auto f = [&](Int x, Int y) { return x <= xr && inside(x, y); }; + + // (a, b) から (c, d) 方向に進めるだけ進む + auto go = [&](Int a, Int b, Int c, Int d) -> Int { + assert(f(a, b)); + Int r = 1, s = 0; + while (f(a + r * c, b + r * d)) r *= 2; + while ((r /= 2) != 0) { + if (f(a + r * c, b + r * d)) s += r, a += r * c, b += r * d; + } + return s; + }; + + // (a, b) が out, (a + c * k, b + d * k) が in とする + // out の間進めるだけ進む + auto go2 = [&](Int a, Int b, Int c, Int d, Int k) { + assert(!inside(a, b) and inside(a + c * k, b + d * k)); + Int ok = 0, ng = k; + while (ok + 1 < ng) { + Int m = (ok + ng) / 2; + (inside(a + c * m, b + d * m) ? ng : ok) = m; + } + return ok; + }; + + vector> ps; + Int x = xl, y = yl; + assert(inside(x, y) and go(x, y, 0, -1) == 0); + ps.emplace_back(x, y); + while (x < xr) { + Int a, b; + if (f(x + 1, y)) { + a = 1, b = 0; + } else { + SternBrocotTreeNode sb; + while (true) { + assert(f(x + sb.lx, y + sb.ly)); + assert(!f(x + sb.rx, y + sb.ry)); + if (f(x + sb.lx + sb.rx, y + sb.ly + sb.ry)) { + Int s = go(x + sb.lx, y + sb.ly, sb.rx, sb.ry); + assert(s > 0); + sb.go_right(s); + } else { + Int s = candicate(x + sb.rx, y + sb.ry, sb.lx, sb.ly); + if (s <= 0 || !inside(x + sb.lx * s + sb.rx, y + sb.ly * s + sb.ry)) { + a = sb.lx, b = sb.ly; + break; + } else { + Int t = go2(x + sb.rx, y + sb.ry, sb.lx, sb.ly, s); + if (!f(x + sb.lx * (t + 1) + sb.rx, y + sb.ly * (t + 1) + sb.ry)) { + a = sb.lx, b = sb.ly; + break; + } + sb.go_left(t); + } + } + } + } + Int s = go(x, y, a, b); + x += a * s, y += b * s; + ps.emplace_back(x, y); + } + return ps; +} diff --git a/math/sum-of-floor.hpp b/math/floor-sum.hpp similarity index 99% rename from math/sum-of-floor.hpp rename to math/floor-sum.hpp index 4829a4cba..9139eb252 100644 --- a/math/sum-of-floor.hpp +++ b/math/floor-sum.hpp @@ -1,7 +1,5 @@ #pragma once - - // sum_{0 <= i < N} (ai + b) // m template T sum_of_floor(T n, T m, T a, T b) { diff --git a/math/gaussian-integer.hpp b/math/gaussian-integer.hpp new file mode 100644 index 000000000..09a63111a --- /dev/null +++ b/math/gaussian-integer.hpp @@ -0,0 +1,57 @@ +#pragma once + +// x + yi +template +struct Gaussian_Integer { + T x, y; + using G = Gaussian_Integer; + + Gaussian_Integer(T _x = 0, T _y = 0) : x(_x), y(_y) {} + Gaussian_Integer(const pair& p) : x(p.fi), y(p.se) {} + + T norm() const { return x * x + y * y; } + G conj() const { return G{x, -y}; } + + G operator+(const G& r) const { return G{x + r.x, y + r.y}; } + G operator-(const G& r) const { return G{x - r.x, y - r.y}; } + G operator*(const G& r) const { + return G{x * r.x - y * r.y, x * r.y + y * r.x}; + } + G operator/(const G& r) const { + G g = G{*this} * r.conj(); + T n = r.norm(); + g.x += n / 2, g.y += n / 2; + return G{g.x / n - (g.x % n < 0), g.y / n - (g.y % n < 0)}; + } + G operator%(const G& r) const { return G{*this} - G{*this} / r * r; } + + G& operator+=(const G& r) { return *this = G{*this} + r; } + G& operator-=(const G& r) { return *this = G{*this} - r; } + G& operator*=(const G& r) { return *this = G{*this} * r; } + G& operator/=(const G& r) { return *this = G{*this} / r; } + G& operator%=(const G& r) { return *this = G{*this} % r; } + G operator-() const { return G{-x, -y}; } + G operator+() const { return G{*this}; } + bool operator==(const G& g) const { return x == g.x && y == g.y; } + bool operator!=(const G& g) const { return x != g.x || y != g.y; } + + G pow(__int128_t e) const { + G res{1}, a{*this}; + while (e) { + if (e & 1) res *= a; + a *= a, e >>= 1; + } + return res; + } + + friend G gcd(G a, G b) { + while (b != G{0, 0}) { + trc(a, b, a / b, a % b); + swap(a %= b, b); + } + return a; + } + friend ostream& operator<<(ostream& os, const G& rhs) { + return os << rhs.x << " " << rhs.y; + } +}; diff --git a/math/two-square.hpp b/math/two-square.hpp new file mode 100644 index 000000000..ae5f69ed7 --- /dev/null +++ b/math/two-square.hpp @@ -0,0 +1,91 @@ +#pragma once + +#include "../internal/internal-math.hpp" +#include "../prime/fast-factorize.hpp" +#include "gaussian-integer.hpp" + +// 解が存在しない場合 (-1, -1) を返す +Gaussian_Integer<__int128_t> solve_norm_equation_prime(long long p) { + if (p % 4 == 3) return {-1, -1}; + if (p == 2) return {1, 1}; + long long x = 1; + while (true) { + x++; + long long z = internal::modpow(x, (p - 1) / 4, p); + if (__int128_t(z) * z % p == p - 1) { + x = z; + break; + } + } + long long y = 1, k = (__int128_t(x) * x + 1) / p; + while (k > 1) { + long long B = x % k, D = y % k; + if (B < 0) B += k; + if (D < 0) D += k; + if (B * 2 > k) B -= k; + if (D * 2 > k) D -= k; + long long nx = (__int128_t(x) * B + __int128_t(y) * D) / k; + long long ny = (__int128_t(x) * D - __int128_t(y) * B) / k; + x = nx, y = ny; + k = (__int128_t(x) * x + __int128_t(y) * y) / p; + } + return {x, y}; +} + +// p^e が long long に収まる +vector> solve_norm_equation_prime_power( + long long p, long long e) { + using G = Gaussian_Integer<__int128_t>; + if (p % 4 == 3) { + if (e % 2 == 1) return {}; + long long x = 1; + for (int i = 0; i < e / 2; i++) x *= p; + return {G{x}}; + } + if (p == 2) return {G{1, 1}.pow(e)}; + G pi = solve_norm_equation_prime(p); + vector pows(e + 1); + pows[0] = 1; + for (int i = 1; i <= e; i++) pows[i] = pows[i - 1] * pi; + vector res(e + 1); + for (int i = 0; i <= e; i++) res[i] = pows[i] * (pows[e - i].conj()); + return res; +} + +// 0 <= arg < 90 の範囲の解のみ返す +vector> solve_norm_equation(long long N) { + using G = Gaussian_Integer<__int128_t>; + if (N < 0) return {}; + if (N == 0) return {G{0}}; + auto pes = factor_count(N); + for (auto& [p, e] : pes) { + if (p % 4 == 3 && e % 2 == 1) return {}; + } + vector res{G{1}}; + for (auto& [p, e] : pes) { + vector cur = solve_norm_equation_prime_power(p, e); + vector nxt; + for (auto& g1 : res) { + for (auto& g2 : cur) nxt.push_back(g1 * g2); + } + res = nxt; + } + + for (auto& g : res) { + while (g.x <= 0 || g.y < 0) g = G{-g.y, g.x}; + } + return res; +} + +// x,y 両方非負のみ, 辞書順で返す +vector> two_square(long long N) { + if (N < 0) return {}; + if (N == 0) return {{0, 0}}; + vector> ans; + for (auto& g : solve_norm_equation(N)) { + ans.emplace_back(g.x, g.y); + if (g.y == 0) ans.emplace_back(g.y, g.x); + } + sort(begin(ans), end(ans)); + return ans; +} diff --git a/misc/doubling.hpp b/misc/doubling.hpp index 86b07201a..bec49d229 100644 --- a/misc/doubling.hpp +++ b/misc/doubling.hpp @@ -9,32 +9,32 @@ struct BinaryLifting { T I; BinaryLifting(int n, uint64_t lim, const T I_ = T()) - : N(n), LOG(__lg(lim) + 2), I(I_) { - table.resize(n, vector(LOG, Data(-1, I))); + : N(n), LOG(__lg(max(lim, 1)) + 2), I(I_) { + table.resize(LOG, vector(n, Data(-1, I))); } - void set_next(int k, int nxt, const T& t) { table[k][0] = Data(nxt, t); } + void set_next(int k, int nxt, const T& t) { table[0][k] = Data(nxt, t); } void build() { for (int k = 0; k + 1 < LOG; ++k) for (int i = 0; i < N; ++i) { - int pre = table[i][k].first; + int pre = table[k][i].first; if (pre == -1) { - table[i][k + 1] = table[i][k]; + table[k + 1][i] = table[k][i]; } else { - table[i][k + 1].first = table[pre][k].first; - table[i][k + 1].second = table[i][k].second + table[pre][k].second; + table[k + 1][i].first = table[k][pre].first; + table[k + 1][i].second = table[k][i].second + table[k][pre].second; } } } - // from i, move t times + // i から t 回進んだ先, (地点, モノイド和) を返す Data query(int i, uint64_t t) const { T d = I; for (int k = LOG - 1; k >= 0; k--) { if ((t >> k) & 1) { - d = d + table[i][k].second; - i = table[i][k].first; + d = d + table[k][i].second; + i = table[k][i].first; } if (i == -1) break; } @@ -42,7 +42,7 @@ struct BinaryLifting { } // query(i, pow(2, k)) - inline Data query_pow(int i, int k) const { return table[i][k]; } + inline Data query_pow(int i, int k) const { return table[k][i]; } // assuming graph is DAG ( edge(u, v) <-> u < v ) // find max j | j <= t, path from i to j exists @@ -51,9 +51,9 @@ struct BinaryLifting { T d = I; uint64_t times = 0; for (int k = LOG - 1; k >= 0; k--) { - int nxt = table[thres][k].first; + int nxt = table[k][thres].first; if (nxt != -1 && nxt <= t) { - d = d + table[thres][k].second; + d = d + table[k][thres].second; thres = nxt; times += 1LL << k; } @@ -68,9 +68,9 @@ struct BinaryLifting { T d = I; uint64_t times = 0; for (int k = LOG - 1; k >= 0; k--) { - int nxt = table[thres][k].first; + int nxt = table[k][thres].first; if (nxt != -1 && nxt >= t) { - d = d + table[thres][k].second; + d = d + table[k][thres].second; thres = nxt; times += 1LL << k; } diff --git a/misc/mo-fast.hpp b/misc/mo-fast.hpp index 385836048..d0c053374 100644 --- a/misc/mo-fast.hpp +++ b/misc/mo-fast.hpp @@ -11,6 +11,7 @@ struct Fast_Mo { int N, Q, width; vector L, R, order; bool is_build; + int nl, nr; Fast_Mo(int _n, int _q) : N(_n), Q(_q), order(Q), is_build(false) { width = max(1, 1.0 * N / max(1.0, sqrt(Q / 2.0))); @@ -28,7 +29,7 @@ struct Fast_Mo { void run(const AL &add_left, const AR &add_right, const DL &delete_left, const DR &delete_right, const REM &rem) { if (!is_build) build(); - int nl = 0, nr = 0; + nl = nr = 0; for (auto idx : order) { while (nl > L[idx]) add_left(--nl); while (nr < R[idx]) add_right(nr++); @@ -61,7 +62,7 @@ struct Fast_Mo { } int dist(int i, int j) { return abs(L[i] - L[j]) + abs(R[i] - R[j]); } - + void climb(int iter = 3, int interval = 5) { vector d(Q - 1); for (int i = 0; i < Q - 1; i++) d[i] = dist(order[i], order[i + 1]); diff --git a/modint/adjunction-modint.hpp b/modint/adjunction-modint.hpp new file mode 100644 index 000000000..a00e52170 --- /dev/null +++ b/modint/adjunction-modint.hpp @@ -0,0 +1,43 @@ +#pragma once + +// a + b sqrt(B) +template +struct Adjunction { + using A = Adjunction; + mint a, b; + Adjunction(mint _a = 0, mint _b = 0) : a(_a), b(_b) {} + Adjunction(long long x) : a(x), b(0) {} + friend A operator+(const A& l, const A& r) { return {l.a + r.a, l.b + r.b}; } + friend A operator-(const A& l, const A& r) { return {l.a - r.a, l.b - r.b}; } + friend A operator*(const A& l, const A& r) { + return {l.a * r.a + l.b * r.b * B, l.a * r.b + l.b * r.a}; + } + friend A operator/(const A& l, const A& r) { return l * r.inverse(); } + + A& operator+=(const A& r) { return (*this) = (*this) + r; } + A& operator-=(const A& r) { return (*this) = (*this) - r; } + A& operator*=(const A& r) { return (*this) = (*this) * r; } + A& operator/=(const A& r) { return (*this) = (*this) / r; } + A operator-() const { return {-a, -b}; } + A operator+() const { return *this; } + + A inverse() const { + mint c = (a * a - b * b * B).inverse(); + return {a * c, -b * c}; + } + A pow(__int128_t e) const { + A res{1}, c{*this}; + while (e) { + if (e & 1) res = res * c; + c *= c; + e >>= 1; + } + return res; + } + + bool operator==(const A& r) const { return a == r.a && b == r.b; } + bool operator!=(const A& r) const { return a != r.a || b != r.b; } + friend ostream& operator<<(ostream& os, const A& rhs) { + return os << rhs.a << " " << rhs.b; + } +}; diff --git a/multiplicative-function/sum-of-multiplicative-function.hpp b/multiplicative-function/sum-of-multiplicative-function.hpp index 95723bdc7..45b9d5280 100644 --- a/multiplicative-function/sum-of-multiplicative-function.hpp +++ b/multiplicative-function/sum-of-multiplicative-function.hpp @@ -14,14 +14,14 @@ struct mf_prefix_sum { T ans; mf_prefix_sum(i64 m) : M(m) { - assert(m < (1LL << 42)); + assert(m <= 1e15); sq = sqrt(M); while (sq * sq > M) sq--; while ((sq + 1) * (sq + 1) <= M) sq++; if (M != 0) { - i64 hls = md(M, sq); - if (hls != 1 && md(M, hls - 1) == sq) hls--; + i64 hls = quo(M, sq); + while (hls != 1 && quo(M, hls - 1) == sq) hls--; s = hls + sq; p = prime_enumerate(sq); @@ -33,11 +33,9 @@ struct mf_prefix_sum { // 素数の個数関数に関するテーブル vector pi_table() { if (M == 0) return {}; - i64 hls = md(M, sq); - if (hls != 1 && md(M, hls - 1) == sq) hls--; - + i64 hls = s - sq; vector hl(hls); - for (int i = 1; i < hls; i++) hl[i] = md(M, i) - 1; + for (int i = 1; i < hls; i++) hl[i] = quo(M, i) - 1; vector hs(sq + 1); iota(begin(hs), end(hs), -1); @@ -45,11 +43,11 @@ struct mf_prefix_sum { int pi = 0; for (auto& x : p) { i64 x2 = i64(x) * x; - i64 imax = min(hls, md(M, x2) + 1); + i64 imax = min(hls, quo(M, x2) + 1); for (i64 i = 1, ix = x; i < imax; ++i, ix += x) { - hl[i] -= (ix < hls ? hl[ix] : hs[md(M, ix)]) - pi; + hl[i] -= (ix < hls ? hl[ix] : hs[quo(M, ix)]) - pi; } - for (int n = sq; n >= x2; n--) hs[n] -= hs[md(n, x)] - pi; + for (int n = sq; n >= x2; n--) hs[n] -= hs[quo(n, x)] - pi; pi++; } @@ -64,31 +62,29 @@ struct mf_prefix_sum { // 素数の prefix sum に関するテーブル vector prime_sum_table() { if (M == 0) return {}; - i64 hls = md(M, sq); - if (hls != 1 && md(M, hls - 1) == sq) hls--; - + i64 hls = s - sq; vector h(s); T inv2 = T{2}.inverse(); for (int i = 1; i < hls; i++) { - T x = md(M, i); + T x = quo(M, i); h[i] = x * (x + 1) * inv2 - 1; } for (int i = 1; i <= sq; i++) { T x = i; - h[s - i] = x * (x + 1) / 2 - 1; + h[s - i] = x * (x + 1) * inv2 - 1; } for (auto& x : p) { T xt = x; T pi = h[s - x + 1]; i64 x2 = i64(x) * x; - i64 imax = min(hls, md(M, x2) + 1); + i64 imax = min(hls, quo(M, x2) + 1); i64 ix = x; for (i64 i = 1; i < imax; ++i, ix += x) { - h[i] -= ((ix < hls ? h[ix] : h[s - md(M, ix)]) - pi) * xt; + h[i] -= ((ix < hls ? h[ix] : h[s - quo(M, ix)]) - pi) * xt; } for (int n = sq; n >= x2; n--) { - h[s - n] -= (h[s - md(n, x)] - pi) * xt; + h[s - n] -= (h[s - quo(n, x)] - pi) * xt; } } @@ -98,39 +94,65 @@ struct mf_prefix_sum { void dfs(int i, int c, i64 prod, T cur) { ans += cur * f(p[i], c + 1); - i64 lim = md(M, prod); + i64 lim = quo(M, prod); if (lim >= 1LL * p[i] * p[i]) dfs(i, c + 1, p[i] * prod, cur); cur *= f(p[i], c); ans += cur * (buf[idx(lim)] - buf[idx(p[i])]); int j = i + 1; - // M < 2**42 -> p_j < 2**21 -> (p_j)^3 < 2**63 - for (; j < ps && 1LL * p[j] * p[j] * p[j] <= lim; j++) { + // p_j < 2**21 -> (p_j)^3 < 2**63 + for (; j < ps && p[j] < (1 << 21) && 1LL * p[j] * p[j] * p[j] <= lim; j++) { dfs(j, 1, prod * p[j], cur); } for (; j < ps && 1LL * p[j] * p[j] <= lim; j++) { T sm = f(p[j], 2); - int id1 = idx(md(lim, p[j])), id2 = idx(p[j]); + int id1 = idx(quo(lim, p[j])), id2 = idx(p[j]); sm += f(p[j], 1) * (buf[id1] - buf[id2]); ans += cur * sm; } } - // fprime 破壊的 - T run(vector& fprime) { + // black algorithm + T run(const vector& Fprime) { if (M == 0) return {}; - set_buf(fprime); - assert((int)buf.size() == s); + assert((int)Fprime.size() == s); + buf = Fprime; ans = buf[idx(M)] + 1; for (int i = 0; i < ps; i++) dfs(i, 1, p[i], 1); return ans; } - i64 md(i64 n, i64 d) { return double(n) / d; } - i64 idx(i64 n) { return n <= sq ? s - n : md(M, n); } - void set_buf(vector& _buf) { swap(buf, _buf); } + vector min_25_sieve(const vector& Fprime) { + if(M == 0) return {}; + assert((int)Fprime.size() == s); + + vector ns{0}; + for (int i = 1; i < s - sq; i++) ns.push_back(quo(M, i)); + for (int i = sq; i > 0; i--) ns.push_back(i); + + vector F = Fprime, G = Fprime; + for (int j = p.size() - 1; j >= 0; j--) { + i64 P = p[j], pc = P, c = 1; + while (quo(M, P) >= pc) { + T f_p_c = f(P, c), f_p_cp1 = f(P, c + 1); + T Fprime_p = Fprime[idx(P)]; + for (int i = 1; i < s; i++) { + i64 n = ns[i]; + if (P * pc > n) break; + G[i] += f_p_c * (F[idx(quo(n, pc))] - Fprime_p) + f_p_cp1; + } + c++, pc *= P; + } + copy(begin(G), begin(G) + min(s, idx(P * P) + 1), begin(F)); + } + for (int i = 1; i < (int)ns.size(); i++) F[i] += 1; + return F; + } + + i64 quo(i64 n, i64 d) { return double(n) / d; } + i64 idx(i64 n) { return n <= sq ? s - n : quo(M, n); } }; /** * @brief 乗法的関数のprefix sum - * @docs docs/multiplicative-function/sum-of-multiplicative-function.md + * @docs docs/multiplicative-function/sum-of-multiplicative-function.quo */ diff --git a/segment-tree/lazy-segment-tree-utility.hpp b/segment-tree/lazy-segment-tree-utility.hpp index 7fd1ddffa..5cbe2abf3 100644 --- a/segment-tree/lazy-segment-tree-utility.hpp +++ b/segment-tree/lazy-segment-tree-utility.hpp @@ -215,11 +215,11 @@ Pair PUpdate(Pair a, T b) { } template Pair Pid() { - return Pair(0, 0); + return Pair(T{}, T{}); } template T Zero() { - return T(0); + return T{}; } template T Const() { @@ -227,8 +227,8 @@ T Const() { } template -struct AddMax_LazySegmentTree - : LazySegmentTreeBase, Add, Add, Const, Zero> { +struct AddMax_LazySegmentTree : LazySegmentTreeBase, Add, Add, + Const, Zero> { using base = LazySegmentTreeBase, Add, Add, Const, Zero>; AddMax_LazySegmentTree(const vector& v) : base(v) {} @@ -244,9 +244,10 @@ struct AddMin_LazySegmentTree template struct AddSum_LazySegmentTree - : LazySegmentTreeBase, T, Psum, Padd, Add, Pid, Zero> { - using base = - LazySegmentTreeBase, T, Psum, Padd, Add, Pid, Zero>; + : LazySegmentTreeBase, T, Psum, Padd, Add, Pid, + Zero> { + using base = LazySegmentTreeBase, T, Psum, Padd, Add, Pid, + Zero>; AddSum_LazySegmentTree(const vector& v) { vector> w(v.size()); for (int i = 0; i < (int)v.size(); i++) w[i] = Pair(v[i], 1); @@ -257,27 +258,27 @@ struct AddSum_LazySegmentTree template struct UpdateMax_LazySegmentTree : LazySegmentTreeBase, Update, Update, Const, - Const> { + Const> { using base = LazySegmentTreeBase, Update, Update, - Const, Const>; + Const, Const>; UpdateMax_LazySegmentTree(const vector& v) : base(v) {} }; template struct UpdateMin_LazySegmentTree : LazySegmentTreeBase, Update, Update, Const, - Const> { - using base = LazySegmentTreeBase, Update, Update, Const, - Const>; + Const> { + using base = LazySegmentTreeBase, Update, Update, + Const, Const>; UpdateMin_LazySegmentTree(const vector& v) : base(v) {} }; template struct UpdateSum_LazySegmentTree : LazySegmentTreeBase, T, Psum, PUpdate, Update, Pid, - Const> { + Const> { using base = LazySegmentTreeBase, T, Psum, PUpdate, Update, - Pid, Const>; + Pid, Const>; UpdateSum_LazySegmentTree(const vector& v) { vector> w(v.size()); for (int i = 0; i < (int)v.size(); i++) w[i] = Pair(v[i], 1); diff --git a/segment-tree/rbst-segment-tree.hpp b/segment-tree/rbst-segment-tree.hpp index f4fd48883..5af5641e8 100644 --- a/segment-tree/rbst-segment-tree.hpp +++ b/segment-tree/rbst-segment-tree.hpp @@ -523,6 +523,10 @@ struct RBSTSegmentTreeBase { Ptr p = _find(root, i); return p ? p->val : ti(); } + bool exist(I i) { + Ptr p = _find(root, i); + return p != nullptr; + } // 1 点 値の書き換え // func の返り値は void !!!!!!(参照された値を直接更新する) @@ -572,26 +576,26 @@ struct RBSTSegmentTreeBase { void shift(const I &sh) { _shift(root, sh); } // key 最小を取得 - I get_min_key(I failed = -1) { return _get_min_keyval(root, failed).first; } + I get_min_key(I failed = {}) { return _get_min_keyval(root, failed).first; } // key 最大を取得 - I get_max_key(I failed = -1) { return _get_max_keyval(root, failed).first; } + I get_max_key(I failed = {}) { return _get_max_keyval(root, failed).first; } // (key, val) 最小を取得 - pair get_min_keyval(I failed = -1) { + pair get_min_keyval(I failed = {}) { return _get_min_keyval(root, failed); } // (key, val) 最大を取得 - pair get_max_keyval(I failed = -1) { + pair get_max_keyval(I failed = {}) { return _get_max_keyval(root, failed); } // (key, val) 最小を pop - pair pop_min_keyval(I failed = -1) { + pair pop_min_keyval(I failed = {}) { assert(root != nullptr); auto kv = _get_min_keyval(root, failed); erase(kv.first); return kv; } // (key, val) 最大を取得 - pair pop_max_keyval(I failed = -1) { + pair pop_max_keyval(I failed = {}) { assert(root != nullptr); auto kv = _get_max_keyval(root, failed); erase(kv.first); diff --git a/string/number-of-subsequences.hpp b/string/number-of-subsequences.hpp new file mode 100644 index 000000000..0cc6b47e2 --- /dev/null +++ b/string/number-of-subsequences.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "../hashmap/hashmap-unerasable.hpp" + +template +mint number_of_subsequences(const Container& S) { + using Key = typename Container::value_type; + UnerasableHashMap mp; + mint al = 1; + for (auto& c : S) { + mint& mpc = mp[c]; + mint x = mpc; + mpc = al; + al += al - x; + } + return al - 1; +} diff --git a/string/run-enumerate.hpp b/string/run-enumerate.hpp new file mode 100644 index 000000000..38719b941 --- /dev/null +++ b/string/run-enumerate.hpp @@ -0,0 +1,72 @@ +#pragma once + +#include +#include +#include +#include +using namespace std; + +#include "z-algorithm.hpp" + +// (p, l, r) : S[l, r) は周期 p かつ極大 +// sum_{(p,l,r)} 1 <= n +// sum_{(p,l,r)} (r-l)/p <= 3n +// sum_{(p,l,r)} (r-l+1-2*p) = O(n log n) +template +vector> run_enumerate(const C& S) { + int N = S.size(); + using T = tuple; + vector>> by_p(N + 1); + + auto solve_sub = [&](const C& l, const C& r) { + vector res; + int n = l.size(), m = r.size(); + C s = l, t = r; + t.insert(end(t), begin(l), end(l)); + t.insert(end(t), begin(r), end(r)); + reverse(begin(s), end(s)); + auto ZS = z_algorithm(s), ZT = z_algorithm(t); + for (int p = 1; p <= n; p++) { + int a = p == n ? p : min(ZS[p] + p, n); + int b = min(ZT[n + m - p], m); + if (a + b < 2 * p) continue; + res.emplace_back(p, a, b); + } + return res; + }; + + auto dfs = [&](auto rc, int L, int R) -> void { + if (R - L <= 1) return; + int M = (L + R) / 2; + rc(rc, L, M), rc(rc, M, R); + C SL{begin(S) + L, begin(S) + M}; + C SR{begin(S) + M, begin(S) + R}; + auto sub_res1 = solve_sub(SL, SR); + for (auto& [p, a, b] : sub_res1) by_p[p].emplace_back(M - a, M + b); + reverse(begin(SL), end(SL)); + reverse(begin(SR), end(SR)); + auto sub_res2 = solve_sub(SR, SL); + for (auto& [p, a, b] : sub_res2) by_p[p].emplace_back(M - b, M + a); + }; + dfs(dfs, 0, N); + + vector res; + set> done; + for (int p = 0; p <= N; p++) { + auto& LR = by_p[p]; + sort(begin(LR), end(LR), [](auto& x, auto& y) { + if (x.first == y.first) return x.second > y.second; + return x.first < y.first; + }); + int r = -1; + for (auto& lr : LR) { + if (r >= lr.second) continue; + r = lr.second; + if (!done.count(lr)) { + done.insert(lr); + res.emplace_back(p, lr.first, lr.second); + } + } + } + return res; +} diff --git a/string/z-algorithm.hpp b/string/z-algorithm.hpp index d193d6fc9..dc659ab45 100644 --- a/string/z-algorithm.hpp +++ b/string/z-algorithm.hpp @@ -1,22 +1,22 @@ #pragma once -template -vector z_algorithm(Container s) { +template +vector z_algorithm(const Container& s) { int n = s.size(); + if(n == 0) return {}; vector a(n); a[0] = n; int i = 1, j = 0; while (i < n) { - while (i + j < n && s[j] == s[i + j]) ++j; + while (i + j < n && s[j] == s[i + j]) j++; a[i] = j; if (j == 0) { - ++i; + i++; continue; } int k = 1; - while (i + k < n && k + a[k] < j) a[i + k] = a[k], ++k; - i += k; - j -= k; + while (i + k < n && k + a[k] < j) a[i + k] = a[k], k++; + i += k, j -= k; } return a; } diff --git a/verify/verify-unit-test/enumerate-convex.test.cpp b/verify/verify-unit-test/enumerate-convex.test.cpp new file mode 100644 index 000000000..c2c67ff00 --- /dev/null +++ b/verify/verify-unit-test/enumerate-convex.test.cpp @@ -0,0 +1,59 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/aplusb" +// +#include "../../template/template.hpp" +// +#include "../../math/enumerate-convex.hpp" +#include "../../math/isqrt.hpp" +#include "../../math/two-square.hpp" +#include "../../misc/rng.hpp" +// +using namespace Nyaan; + +vector> calc(ll N) { + ll m = isqrt(N); + // (0, m) を中心とする半径 sqrt(N) の円 + auto inside = [&](ll x, ll y) { + return y >= m or x * x + (y - m) * (y - m) <= N; + }; + auto candicate = [&](ll x, ll y, ll c, ll d) { + // (x + sc)^2 + (y - m + sd)^2 <= N + ll A = c * c + d * d; + ll B = 2 * c * x + 2 * d * (y - m); + // A s^2 + B s + const <= 0 + ll num = -B, den = 2 * A; + ll quo = num / den, rem = num % den; + if (rem < 0) quo--, rem += den; + if (2 * rem > den) quo++, rem -= den; + return quo; + }; + + auto ans = enumerate_convex(0, 0, m, inside, candicate); + vector> res; + each2(x, y, ans) if (x * x + (y - m) * (y - m) == N) { + res.emplace_back(x, m - y); + } + sort(begin(res), end(res)); + return res; +} + +void check(long long N) { + auto ac = two_square(N); + auto ad = calc(N); + assert(ac == ad); +} + +void q() { + rep1(N, 1000) check(N); + rep(t, 100) check(rng(1001, TEN(9))); + check(TEN(18)); + + trc2("OK"); + inl(a, b); + out(a + b); +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} diff --git a/verify/verify-unit-test/math.test.cpp b/verify/verify-unit-test/math.test.cpp index 64f1b461a..1fdc9483f 100644 --- a/verify/verify-unit-test/math.test.cpp +++ b/verify/verify-unit-test/math.test.cpp @@ -5,7 +5,7 @@ #include "../../math/gray-code.hpp" #include "../../math/inv-mod.hpp" #include "../../math/isqrt.hpp" -#include "../../math/sum-of-floor.hpp" +#include "../../math/floor-sum.hpp" #include "../../misc/rng.hpp" using namespace Nyaan; diff --git a/verify/verify-unit-test/sum-of-mf.test.cpp b/verify/verify-unit-test/sum-of-mf.test.cpp index 22ed7a08f..18e7f1fcf 100644 --- a/verify/verify-unit-test/sum-of-mf.test.cpp +++ b/verify/verify-unit-test/sum-of-mf.test.cpp @@ -7,14 +7,12 @@ #include "../../multiplicative-function/sum-of-totient.hpp" // #include "../../modint/montgomery-modint.hpp" -#include "../../modulo/binomial.hpp" // using namespace Nyaan; using mint = LazyMontgomeryModInt<998244353>; // using mint = LazyMontgomeryModInt<1000000007>; using vm = vector; using vvm = vector; -Binomial C; using namespace Nyaan; @@ -35,12 +33,18 @@ void Nyaan::solve() { auto h1 = mf.prime_sum_table(); auto h0 = mf.pi_table(); assert(sz(h1) == sz(h0)); - rep(i, sz(h1)) h1[i] -= h0[i]; + rep(j, sz(h1)) h1[j] -= h0[j]; + + auto g = mf.min_25_sieve(h1); + rep1(j, mf.s - mf.sq - 1) assert(g[j] == tot[i / j]); + rep1(j, mf.sq) assert(g[mf.s - j] == tot[j]); + mint ans = mf.run(h1); assert(tot[i] == ans); } + trc2("OK"); int a, b; cin >> a >> b; cout << a + b << endl; -} \ No newline at end of file +} diff --git a/verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp b/verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp new file mode 100644 index 000000000..1bea3da3b --- /dev/null +++ b/verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp @@ -0,0 +1,38 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/range_parallel_unionfind" +// +#include "../../template/template.hpp" +// +#include "../../data-structure/parallel-union-find.hpp" +// +#include "../../modint/montgomery-modint.hpp" +// +using namespace Nyaan; +using mint = LazyMontgomeryModInt<998244353>; +// using mint = LazyMontgomeryModInt<1000000007>; +using vm = vector; +using vvm = vector; + +using namespace Nyaan; + +void q() { + ini(N, Q); + vm X(N); + in(X); + + ParallelUnionFind uf(N); + mint ans = 0; + rep(i, Q) { + inl(k, a, b); + uf.unite(a, a + k, b, b + k, [&](int x, int y) { + ans += X[x] * X[y]; + X[x] += X[y]; + }); + out(ans); + } +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} \ No newline at end of file diff --git a/verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp b/verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp new file mode 100644 index 000000000..faaa4779e --- /dev/null +++ b/verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp @@ -0,0 +1,19 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/gcd_of_gaussian_integers" +// +#include "../../template/template.hpp" +// +#include "../../math/gaussian-integer.hpp" + +using namespace Nyaan; + +void q() { + inl(a1, b1, a2, b2); + Gaussian_Integer z1{a1, b1}, z2{a2, b2}; + out(gcd(z1, z2)); +} + +void Nyaan::solve() { + int t = 1; + in(t); + while (t--) q(); +} diff --git a/verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp b/verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp index 01ecbfe23..4fa145ead 100644 --- a/verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp +++ b/verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM "https://judge.yosupo.jp/problem/sum_of_floor_of_linear" #include "../../template/template.hpp" -#include "../../math/sum-of-floor.hpp" +#include "../../math/floor-sum.hpp" using namespace Nyaan; void Nyaan::solve() { ini(T); diff --git a/verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp b/verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp new file mode 100644 index 000000000..d886650b5 --- /dev/null +++ b/verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp @@ -0,0 +1,19 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/two_square_sum" +// +#include "../../template/template.hpp" +// +#include "../../math/two-square.hpp" +using namespace Nyaan; + +void q() { + inl(N); + auto ans = two_square(N); + out(sz(ans)); + each(p, ans) out(p); +} + +void Nyaan::solve() { + int t = 1; + in(t); + while (t--) q(); +} diff --git a/verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp b/verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp new file mode 100644 index 000000000..0481bb2fc --- /dev/null +++ b/verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp @@ -0,0 +1,28 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/number_of_subsequences" +// +#include "../../template/template.hpp" +// +#include "../../string/number-of-subsequences.hpp" +// +#include "../../modint/montgomery-modint.hpp" +#include "../../modulo/binomial.hpp" +// +using namespace Nyaan; +using mint = LazyMontgomeryModInt<998244353>; +// using mint = LazyMontgomeryModInt<1000000007>; +using vm = vector; +using vvm = vector; +Binomial C; + +void q() { + ini(N); + vi A(N); + in(A); + out(number_of_subsequences(A).get()); +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} diff --git a/verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp b/verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp new file mode 100644 index 000000000..ae7ccbcfd --- /dev/null +++ b/verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp @@ -0,0 +1,19 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/runenumerate" +// +#include "../../template/template.hpp" +// +#include "../../string/run-enumerate.hpp" +using namespace Nyaan; + +void q() { + ins(S); + auto ans = run_enumerate(S); + out(sz(ans)); + for (auto& [t, l, r] : ans) out(t, l, r); +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} diff --git a/verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp b/verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp new file mode 100644 index 000000000..1740ea3c1 --- /dev/null +++ b/verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp @@ -0,0 +1,19 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/wildcard_pattern_matching" +// +#include "../../template/template.hpp" +// +#include "../../string/wildcard-pattern-matching.hpp" +using namespace Nyaan; + +void q() { + ins(S, T); + auto ans = wildcard_pattern_matching(S, T, '*'); + each(x, ans) cout << x; + cout << "\n"; +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} diff --git a/verify/verify-yuki/yuki-2883.test.cpp b/verify/verify-yuki/yuki-2883.test.cpp new file mode 100644 index 000000000..fc25bbe5c --- /dev/null +++ b/verify/verify-yuki/yuki-2883.test.cpp @@ -0,0 +1,44 @@ +#define PROBLEM "https://yukicoder.me/problems/no/2883" +// +#include "../../template/template.hpp" +// +#include "../../modint/adjunction-modint.hpp" +// +#include "../../modint/montgomery-modint.hpp" +#include "../../modulo/binomial.hpp" +// +using namespace Nyaan; +using mint = LazyMontgomeryModInt<998244353>; +// using mint = LazyMontgomeryModInt<1000000007>; +using vm = vector; +using vvm = vector; +Binomial C; + +using namespace Nyaan; + +void q() { + inl(N, K); + using A = Adjunction; + A a{C.inv(2), +C.inv(2)}; + A b{C.inv(2), -C.inv(2)}; + A ans = 0; + rep(i, K + 1) { + A cur = 1; + cur *= C(K, i) * mint{-1}.pow(i); + A c = a.pow(K - i) * b.pow(i); + if (c == A{1, 0}) { + cur *= c * N; + } else { + cur *= c * (c.pow(N) - 1) / (c - 1); + } + ans += cur; + } + ans *= A{0, 1}.inverse().pow(K); + out(ans.a); +} + +void Nyaan::solve() { + int t = 1; + // in(t); + while (t--) q(); +} From 6830be95659a47bbf6248c44f92202d915f5048a Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 14 Sep 2024 11:55:53 +0000 Subject: [PATCH 2/8] [auto-verifier] verify commit f27b52f183f083876df382c4bc1b4ff400458520 --- .verify-helper/timestamps.remote.json | 45 +++++++++------------------ 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index d63afa21c..41bd21da6 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -26,16 +26,16 @@ "verify/verify-aoj-dsl/aoj-dsl-2-a-segtree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-dsl/aoj-dsl-2-b-bit.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-dsl/aoj-dsl-2-b-segtree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-d.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-d.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-aoj-dsl/aoj-dsl-2-e-imos.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-e.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-f-max.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-f.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-e.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-f-max.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-f.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-aoj-dsl/aoj-dsl-2-g-bit.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-g.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-h-max.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-h.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-aoj-dsl/aoj-dsl-2-i.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-g.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-h-max.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-h.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-aoj-dsl/aoj-dsl-2-i.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-aoj-dsl/aoj-dsl-3-d-cartesiantree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-dsl/aoj-dsl-3-d.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-dsl/aoj-dsl-5-b-2dseg.test.cpp": "2024-05-03 23:21:26 +0900", @@ -58,7 +58,7 @@ "verify/verify-aoj-grl/aoj-grl-5-b.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-grl/aoj-grl-5-c.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-grl/aoj-grl-5-d.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-aoj-grl/aoj-grl-5-e.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-aoj-grl/aoj-grl-5-e.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-aoj-itp/aoj-itp2-11-b.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-itp/aoj-itp2-11-c.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-aoj-ntl/aoj-ntl-1-a.test.cpp": "2024-05-03 23:21:26 +0900", @@ -108,6 +108,7 @@ "verify/verify-unit-test/dijkstra.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/dual-fps.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/dynamic-diameter.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-unit-test/enumerate-convex.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/enumerate-quotient.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/erasable-priority-queue.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-unit-test/factorize.test.cpp": "2024-05-03 23:21:26 +0900", @@ -130,14 +131,14 @@ "verify/verify-unit-test/interval-union.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/inverse-matrix.test.cpp": "2024-05-03 21:06:15 +0900", "verify/verify-unit-test/karatsuba.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/lazyseg-bsearch.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-unit-test/lazyseg-bsearch.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/lazyseg-setval-2.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/lazyseg-setval.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-unit-test/lazyseg-setval.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/li-chao-tree-abstruct.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/manacher.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/math-fast-2.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/math-fast.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/math.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-unit-test/math.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/mf.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/modint-2-61m1.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-unit-test/modint.test.cpp": "2024-05-03 23:21:26 +0900", @@ -150,7 +151,7 @@ "verify/verify-unit-test/orderedmap.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/osak.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/p-recursive.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/parallel-union-find.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-unit-test/parallel-union-find.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/partial-fraction-decomposition.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/polynomial-matrix-prod.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/primality-test.test.cpp": "2024-05-03 23:21:26 +0900", @@ -158,8 +159,6 @@ "verify/verify-unit-test/radix-heap.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/radix-sort.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/rational-number.test.cpp": "2024-08-10 13:03:16 +0900", -"verify/verify-unit-test/rbst-segment-tree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/rbst-sequence.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/relaxed-convolution.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/rerooting.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/run-length-encoding.test.cpp": "2024-05-03 23:21:26 +0900", @@ -173,12 +172,10 @@ "verify/verify-unit-test/stirling-matrix.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/strassen.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/string-search.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/sum-of-mf.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/template.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/tree-path.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-unit-test/wavelet-matrix.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-associative-array-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-associative-array-rbstseg.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-associative-array-unerasable-hashmap.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-binary-trie.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-deque-operate-all-composite.test.cpp": "2024-05-03 23:21:26 +0900", @@ -193,7 +190,6 @@ "verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-set-path-composite.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-hash-map-variable-length.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-hashmap.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-lazysegtree-2.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yosupo-ds/yosupo-lazysegtree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-line-add-get-min.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-offline-dynamic-connectivity.test.cpp": "2024-05-03 23:21:26 +0900", @@ -209,17 +205,12 @@ "verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-segtree-on-wm.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-wm.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-point-set-range-composite-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg2.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-precedessor-problem-segtree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-predecessor-problem-vEB-tree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-predecessor-problem.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-procedessor-problem-rbstseg.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-add-range-sum-linkcuttree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-range-affine-point-get-2.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-point-get.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-range-sum-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-range-affine-range-sum-rbstseg.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-sqdec.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-reverse-range-sum.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-set-range-composite.test.cpp": "2024-05-03 23:21:26 +0900", @@ -227,7 +218,6 @@ "verify/verify-yosupo-ds/yosupo-rollback-union-find.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-segment-add-get-min.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-segtree-beats.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-ds/yosupo-static-range-inversion-query-2.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-static-range-inversions-query.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-static-rectangle-add-rectangle-sum.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-static-rmq.test.cpp": "2024-05-03 23:21:26 +0900", @@ -291,7 +281,6 @@ "verify/verify-yosupo-graph/yosupo-exp-of-set-power-series.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-frequency-table-of-tree-distance.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-jump-on-tree.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-doubling.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-euler-tour.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-tree-util.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor.test.cpp": "2024-05-03 23:21:26 +0900", @@ -368,8 +357,6 @@ "verify/verify-yosupo-math/yosupo-stern-brocot-tree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-subset-convolution-fast.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-subset-convolution.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-math/yosupo-sum-of-totient-2.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-sum-of-totient-3.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-sum-of-totient.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-tetration-mod.test.cpp": "2024-05-03 23:21:26 +0900", @@ -407,7 +394,6 @@ "verify/verify-yosupo-string/yosupo-number-of-substrings-suffixautomaton.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-number-of-substrings.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-suffix-array.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yosupo-string/yosupo-z-algorithm.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-zalgo-rollinghash.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-zalgo-suffixarray.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-0002.test.cpp": "2024-05-03 23:21:26 +0900", @@ -460,7 +446,6 @@ "verify/verify-yuki/yuki-1340-bitmatrix.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yuki/yuki-1340-semiring.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1460.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yuki/yuki-1467-weighted.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1467.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1504.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1510.test.cpp": "2024-05-03 23:21:26 +0900", @@ -468,9 +453,7 @@ "verify/verify-yuki/yuki-1775.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1777.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1778.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yuki/yuki-1781.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1783.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-yuki/yuki-1786.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1787.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1789.test.cpp": "2024-05-04 15:53:37 +0900", "verify/verify-yuki/yuki-1875.test.cpp": "2024-05-03 23:21:26 +0900", From 4397f94fe30549edb9cdd207fd5d6cde5138d144 Mon Sep 17 00:00:00 2001 From: NyaanNyaan Date: Sat, 14 Sep 2024 23:01:51 +0900 Subject: [PATCH 3/8] fix bugs --- .../verify-unit-test/rbst-segment-tree.test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/verify/verify-unit-test/rbst-segment-tree.test.cpp b/verify/verify-unit-test/rbst-segment-tree.test.cpp index c367423bd..3170952c9 100644 --- a/verify/verify-unit-test/rbst-segment-tree.test.cpp +++ b/verify/verify-unit-test/rbst-segment-tree.test.cpp @@ -94,7 +94,7 @@ void test(const int N = 100, const int Q = 100) { // get_min_key, get_min_keyval int v1 = -1; while (true) { - v1 = seg1.get_min_key(); + v1 = seg1.get_min_key(-1); if (v1 == -1) break; T val = seg2.get_val(v1); if (val.second == 1) break; @@ -120,10 +120,10 @@ void test(const int N = 100, const int Q = 100) { assert(v1 == v2 && "get_min_key"); if (v1 == -1) { - auto kv1 = seg1.get_min_keyval(); + auto kv1 = seg1.get_min_keyval(-1); assert(kv1.second == T{} && "get_min_keyval"); } else { - auto kv1 = seg1.get_min_keyval(); + auto kv1 = seg1.get_min_keyval(-1); auto kv2 = make_pair(v2, seg2.get_val(v2)); assert(kv1 == kv2 && "get_min_keyval"); } @@ -132,7 +132,7 @@ void test(const int N = 100, const int Q = 100) { // get_max_key, get_max_keyval int v1 = -1; while (true) { - v1 = seg1.get_max_key(); + v1 = seg1.get_max_key(-1); if (v1 == -1) break; T val = seg2.get_val(v1); if (val.second == 1) break; @@ -158,10 +158,10 @@ void test(const int N = 100, const int Q = 100) { assert(v1 == v2 && "get_max_key"); if (v1 == -1) { - auto kv1 = seg1.get_max_keyval(); + auto kv1 = seg1.get_max_keyval(-1); assert(kv1.second == T{} && "get_max_keyval"); } else { - auto kv1 = seg1.get_max_keyval(); + auto kv1 = seg1.get_max_keyval(-1); auto kv2 = make_pair(v2, seg2.get_val(v2)); assert(kv1 == kv2 && "get_mix_keyval"); } @@ -182,7 +182,7 @@ void test(const int N = 100, const int Q = 100) { if (v2 != -1) { pair kv1; do { - kv1 = seg1.pop_min_keyval(); + kv1 = seg1.pop_min_keyval(-1); } while (kv1.second.second == 0); auto kv2 = make_pair(v2, seg2.get_val(v2)); assert(kv1 == kv2 && "pop_min_keyval"); @@ -205,7 +205,7 @@ void test(const int N = 100, const int Q = 100) { if (v2 != -1) { pair kv1; do { - kv1 = seg1.pop_max_keyval(); + kv1 = seg1.pop_max_keyval(-1); } while (kv1.second.second == 0); auto kv2 = make_pair(v2, seg2.get_val(v2)); assert(kv1 == kv2 && "pop_max_keyval"); From 3ac52ded48993ece356096f7f9efa9574116b02f Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 14 Sep 2024 14:13:18 +0000 Subject: [PATCH 4/8] [auto-verifier] verify commit 4397f94fe30549edb9cdd207fd5d6cde5138d144 --- .verify-helper/timestamps.remote.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 41bd21da6..0cec35a86 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -159,6 +159,8 @@ "verify/verify-unit-test/radix-heap.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/radix-sort.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/rational-number.test.cpp": "2024-08-10 13:03:16 +0900", +"verify/verify-unit-test/rbst-segment-tree.test.cpp": "2024-09-14 23:01:51 +0900", +"verify/verify-unit-test/rbst-sequence.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/relaxed-convolution.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/rerooting.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/run-length-encoding.test.cpp": "2024-05-03 23:21:26 +0900", @@ -172,10 +174,12 @@ "verify/verify-unit-test/stirling-matrix.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/strassen.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/string-search.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-unit-test/sum-of-mf.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-unit-test/template.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/tree-path.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-unit-test/wavelet-matrix.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-associative-array-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-associative-array-rbstseg.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-associative-array-unerasable-hashmap.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-binary-trie.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-deque-operate-all-composite.test.cpp": "2024-05-03 23:21:26 +0900", @@ -190,6 +194,7 @@ "verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-set-path-composite.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-hash-map-variable-length.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-hashmap.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-lazysegtree-2.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-lazysegtree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-line-add-get-min.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-offline-dynamic-connectivity.test.cpp": "2024-05-03 23:21:26 +0900", @@ -205,19 +210,26 @@ "verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-segtree-on-wm.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-wm.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-point-set-range-composite-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg2.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-precedessor-problem-segtree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-predecessor-problem-vEB-tree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-predecessor-problem.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-procedessor-problem-rbstseg.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-range-add-range-sum-linkcuttree.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-range-affine-point-get-2.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-point-get.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-range-sum-dynamic-segtree.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-range-affine-range-sum-rbstseg.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-range-affine-sqdec.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-range-reverse-range-sum.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-range-set-range-composite.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-rectangle-sum.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-rollback-union-find.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-segment-add-get-min.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-segtree-beats.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-ds/yosupo-static-range-inversion-query-2.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ds/yosupo-static-range-inversions-query.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-static-rectangle-add-rectangle-sum.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ds/yosupo-static-rmq.test.cpp": "2024-05-03 23:21:26 +0900", @@ -281,6 +293,7 @@ "verify/verify-yosupo-graph/yosupo-exp-of-set-power-series.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-frequency-table-of-tree-distance.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-jump-on-tree.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-doubling.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-euler-tour.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-tree-util.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-graph/yosupo-lowest-common-ancestor.test.cpp": "2024-05-03 23:21:26 +0900", @@ -325,6 +338,7 @@ "verify/verify-yosupo-math/yosupo-enumerate-quotient.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-factorization.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-gcd-convolution.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-math/yosupo-hafnian-of-matrix.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-inverse-matrix-mod-2.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yosupo-math/yosupo-inverse-matrix.test.cpp": "2024-05-03 23:21:26 +0900", @@ -357,11 +371,14 @@ "verify/verify-yosupo-math/yosupo-stern-brocot-tree.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-subset-convolution-fast.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-subset-convolution.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-yosupo-math/yosupo-sum-of-totient-2.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-math/yosupo-sum-of-totient-3.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-sum-of-totient.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-tetration-mod.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-two-sat-atcoder.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-math/yosupo-two-sat.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-ntt/yosupo-convolution-2-64-karatsuba.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ntt/yosupo-convolution-arbitrarylengthntt.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-ntt/yosupo-convolution-arbitraryntt-arbitrarymodint.test.cpp": "2024-05-03 23:21:26 +0900", @@ -391,9 +408,13 @@ "verify/verify-yosupo-other/yosupo-static-convex-hull-2.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-other/yosupo-static-convex-hull.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-enumerate-palindromes-roriha.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-string/yosupo-number-of-substrings-suffixautomaton.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-number-of-substrings.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-string/yosupo-suffix-array.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-yosupo-string/yosupo-z-algorithm.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yosupo-string/yosupo-zalgo-rollinghash.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yosupo-string/yosupo-zalgo-suffixarray.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-0002.test.cpp": "2024-05-03 23:21:26 +0900", @@ -446,6 +467,7 @@ "verify/verify-yuki/yuki-1340-bitmatrix.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yuki/yuki-1340-semiring.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1460.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yuki/yuki-1467-weighted.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yuki/yuki-1467.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1504.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1510.test.cpp": "2024-05-03 23:21:26 +0900", From d46dbf63a7f2b26c9cff5738d63e4fa14d2350e9 Mon Sep 17 00:00:00 2001 From: NyaanNyaan Date: Sat, 14 Sep 2024 23:14:50 +0900 Subject: [PATCH 5/8] empty commit From 9c86f74605681685c67f21dd89caa3d01aad4461 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 14 Sep 2024 14:16:22 +0000 Subject: [PATCH 6/8] [auto-verifier] verify commit d46dbf63a7f2b26c9cff5738d63e4fa14d2350e9 --- .verify-helper/timestamps.remote.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 0cec35a86..7fbdca94f 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -475,7 +475,9 @@ "verify/verify-yuki/yuki-1775.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1777.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1778.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yuki/yuki-1781.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yuki/yuki-1783.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yuki/yuki-1786.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yuki/yuki-1787.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-1789.test.cpp": "2024-05-04 15:53:37 +0900", "verify/verify-yuki/yuki-1875.test.cpp": "2024-05-03 23:21:26 +0900", @@ -494,6 +496,7 @@ "verify/verify-yuki/yuki-2588.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yuki/yuki-2661.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-yuki/yuki-2677.test.cpp": "2024-05-03 23:21:26 +0900", +"verify/verify-yuki/yuki-2883.test.cpp": "2024-09-14 20:40:02 +0900", "verify/verify-yuki/yuki-3024.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-yuki/yuki-helloworld.test.cpp": "2024-05-03 23:21:26 +0900" } \ No newline at end of file From dde70d7ffc2d639c87578245e7798552dc19df7d Mon Sep 17 00:00:00 2001 From: NyaanNyaan Date: Sat, 14 Sep 2024 23:22:31 +0900 Subject: [PATCH 7/8] remove unneccesary branch --- math/enumerate-convex.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/math/enumerate-convex.hpp b/math/enumerate-convex.hpp index 12717ecce..296258545 100644 --- a/math/enumerate-convex.hpp +++ b/math/enumerate-convex.hpp @@ -69,10 +69,6 @@ vector> enumerate_convex( break; } else { Int t = go2(x + sb.rx, y + sb.ry, sb.lx, sb.ly, s); - if (!f(x + sb.lx * (t + 1) + sb.rx, y + sb.ly * (t + 1) + sb.ry)) { - a = sb.lx, b = sb.ly; - break; - } sb.go_left(t); } } From f4a0b69220afcfa1d629ec71701478eba02fafbc Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 14 Sep 2024 14:24:02 +0000 Subject: [PATCH 8/8] [auto-verifier] verify commit dde70d7ffc2d639c87578245e7798552dc19df7d --- .verify-helper/timestamps.remote.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 7fbdca94f..2d43df4d9 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -108,7 +108,7 @@ "verify/verify-unit-test/dijkstra.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/dual-fps.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/dynamic-diameter.test.cpp": "2024-05-03 23:21:26 +0900", -"verify/verify-unit-test/enumerate-convex.test.cpp": "2024-09-14 20:40:02 +0900", +"verify/verify-unit-test/enumerate-convex.test.cpp": "2024-09-14 23:22:31 +0900", "verify/verify-unit-test/enumerate-quotient.test.cpp": "2024-05-03 23:21:26 +0900", "verify/verify-unit-test/erasable-priority-queue.test.cpp": "2024-08-10 13:03:16 +0900", "verify/verify-unit-test/factorize.test.cpp": "2024-05-03 23:21:26 +0900",