From 3b4b4780e0ebb4ece3d5a58f3c6595a71dbd3704 Mon Sep 17 00:00:00 2001 From: ei1333 Date: Mon, 10 Aug 2026 16:05:49 +0000 Subject: [PATCH 1/3] Fix AOJ 2725 verifier infinity sentinel --- test/verify/aoj-2725.test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/verify/aoj-2725.test.cpp b/test/verify/aoj-2725.test.cpp index 8b3b8486..4590c239 100644 --- a/test/verify/aoj-2725.test.cpp +++ b/test/verify/aoj-2725.test.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -12,7 +11,7 @@ using namespace std; -constexpr int64_t kInfinity = numeric_limits::max(); +constexpr int64_t kInfinity = int64_t{1} << 60; int main() { int N, T; From 2f9c4a5a47580ada46649dcf9a0f6ee1de4456ea Mon Sep 17 00:00:00 2001 From: ei1333 Date: Mon, 10 Aug 2026 16:07:23 +0000 Subject: [PATCH 2/3] Fix AOJ 2603 verifier infinity sentinel --- test/verify/aoj-2603.test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/verify/aoj-2603.test.cpp b/test/verify/aoj-2603.test.cpp index 0efa13ff..670a4ea3 100644 --- a/test/verify/aoj-2603.test.cpp +++ b/test/verify/aoj-2603.test.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include "../../dp/divide-and-conquer-optimization.hpp" @@ -28,7 +27,7 @@ int main() { mat[left][right] = mat[left + 1][right] + T[right] - T[left]; } } - const int infinity = numeric_limits::max(); + const int infinity = (1 << 30) - 1; auto val = divide_and_conquer_optimization( M, N, infinity, [&](int a, int b) { return mat[a][b - 1]; }); int ret = infinity; From 627101a634eb0efa995356ee14aea0f5caee4ce9 Mon Sep 17 00:00:00 2001 From: ei1333 Date: Mon, 10 Aug 2026 15:44:16 +0000 Subject: [PATCH 3/3] Add blank lines after include blocks --- geometry/template.hpp | 1 + graph/flow/bipartite-flow.hpp | 1 + graph/flow/bipartite-matching.hpp | 1 + graph/flow/dinic-capacity-scaling.hpp | 1 + graph/flow/dinic.hpp | 1 + graph/flow/ford-fulkerson.hpp | 1 + graph/flow/gabow-edmonds.hpp | 1 + graph/flow/maxflow-lower-bound.hpp | 1 + graph/flow/primal-dual.hpp | 1 + graph/flow/push-relabel.hpp | 1 + graph/shortest-path/shortest-nonzero-path.hpp | 1 + graph/tree/static-top-tree.hpp | 1 + math/combinatorics/vectorize-mod-int.hpp | 1 + math/fps/bell.hpp | 1 + math/fps/berlekamp-massey.hpp | 1 + math/fps/coeff-of-rational-function.hpp | 1 + math/fps/count-subset-sum.hpp | 1 + math/fps/eulerian.hpp | 1 + math/fps/sparse-matrix.hpp | 1 + math/fps/stirling-second.hpp | 1 + math/fps/subproduct-tree.hpp | 1 + string/palindromic-tree.hpp | 1 + string/suffix-array.hpp | 1 + structure/bbst/lazy-red-black-tree.hpp | 1 + structure/bbst/lazy-reversible-splay-tree.hpp | 1 + structure/bbst/lazy-weight-balanced-tree.hpp | 1 + structure/bbst/persistent-lazy-red-black-tree.hpp | 1 + structure/bbst/persistent-lazy-weight-balanced-tree.hpp | 1 + structure/bbst/persistent-red-black-tree.hpp | 1 + structure/bbst/persistent-weight-balanced-tree.hpp | 1 + structure/bbst/randomized-binary-search-tree-lazy.hpp | 1 + structure/bbst/randomized-binary-search-tree-set.hpp | 1 + structure/bbst/randomized-binary-search-tree.hpp | 1 + structure/bbst/red-black-tree.hpp | 1 + structure/bbst/reversible-splay-tree.hpp | 1 + structure/bbst/weight-balanced-tree.hpp | 1 + structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp | 1 + structure/convex-hull-trick/dynamic-li-chao-tree.hpp | 1 + structure/convex-hull-trick/li-chao-tree.hpp | 1 + structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp | 1 + structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp | 1 + structure/dynamic-tree/dynamic-tree-builder-for-vertex.hpp | 1 + structure/dynamic-tree/lazy-link-cut-tree.hpp | 1 + structure/dynamic-tree/lazy-top-tree.hpp | 1 + structure/dynamic-tree/link-cut-tree-for-subtree.hpp | 1 + structure/dynamic-tree/link-cut-tree.hpp | 1 + structure/dynamic-tree/top-tree.hpp | 1 + structure/heap/fibonacchi-heap.hpp | 1 + structure/others/generalized-slope-trick.hpp | 1 + .../segment-tree/range-linear-add-range-min-segment-tree.hpp | 1 + structure/segment-tree/range-tree.hpp | 1 + structure/segment-tree/segment-tree-fractional-cascading.hpp | 1 + structure/trie/binary-trie.hpp | 1 + structure/wavelet/succinct-indexable-dictionary.hpp | 1 + structure/wavelet/wavelet-tree.hpp | 1 + template/template.hpp | 2 ++ 56 files changed, 57 insertions(+) diff --git a/geometry/template.hpp b/geometry/template.hpp index 0e94535f..0edde5b5 100644 --- a/geometry/template.hpp +++ b/geometry/template.hpp @@ -10,6 +10,7 @@ #include #include #include + using Real = double; using Point = std::complex; const Real EPS = 1e-8, PI = std::acos(-1); diff --git a/graph/flow/bipartite-flow.hpp b/graph/flow/bipartite-flow.hpp index 54203b7b..09353c0a 100644 --- a/graph/flow/bipartite-flow.hpp +++ b/graph/flow/bipartite-flow.hpp @@ -7,6 +7,7 @@ #include #include #include + /** * @brief Bipartite Flow(二部グラフのフロー) * diff --git a/graph/flow/bipartite-matching.hpp b/graph/flow/bipartite-matching.hpp index ac8a1e94..b95e9bfe 100644 --- a/graph/flow/bipartite-matching.hpp +++ b/graph/flow/bipartite-matching.hpp @@ -2,6 +2,7 @@ #include #include + /** * @brief Bipartite-Matching(二部グラフの最大マッチング) * diff --git a/graph/flow/dinic-capacity-scaling.hpp b/graph/flow/dinic-capacity-scaling.hpp index aeba3bc7..8d03f9b3 100644 --- a/graph/flow/dinic-capacity-scaling.hpp +++ b/graph/flow/dinic-capacity-scaling.hpp @@ -6,6 +6,7 @@ #include #include #include + /** * @brief Dinic Capacity Scaling(最大流) * diff --git a/graph/flow/dinic.hpp b/graph/flow/dinic.hpp index 0d403cdf..d223349e 100644 --- a/graph/flow/dinic.hpp +++ b/graph/flow/dinic.hpp @@ -5,6 +5,7 @@ #include #include #include + /** * @brief Dinic(最大流) * diff --git a/graph/flow/ford-fulkerson.hpp b/graph/flow/ford-fulkerson.hpp index 8bd9276e..8b2a68a9 100644 --- a/graph/flow/ford-fulkerson.hpp +++ b/graph/flow/ford-fulkerson.hpp @@ -4,6 +4,7 @@ #include #include #include + /** * @brief Ford Fulkerson(最大流) * diff --git a/graph/flow/gabow-edmonds.hpp b/graph/flow/gabow-edmonds.hpp index caac195f..253724bf 100644 --- a/graph/flow/gabow-edmonds.hpp +++ b/graph/flow/gabow-edmonds.hpp @@ -3,6 +3,7 @@ #include #include #include + // https://qiita.com/Kutimoti_T/items/5b579773e0a24d650bdf /** diff --git a/graph/flow/maxflow-lower-bound.hpp b/graph/flow/maxflow-lower-bound.hpp index 6991e532..a6e1d940 100644 --- a/graph/flow/maxflow-lower-bound.hpp +++ b/graph/flow/maxflow-lower-bound.hpp @@ -4,6 +4,7 @@ #include #include #include + template class F> struct MaxFlowLowerBound { F flow; diff --git a/graph/flow/primal-dual.hpp b/graph/flow/primal-dual.hpp index 4f91274f..7b38bc84 100644 --- a/graph/flow/primal-dual.hpp +++ b/graph/flow/primal-dual.hpp @@ -7,6 +7,7 @@ #include #include #include + /** * @brief Primal Dual(最小費用流) * diff --git a/graph/flow/push-relabel.hpp b/graph/flow/push-relabel.hpp index 3a1a6232..e40f0587 100644 --- a/graph/flow/push-relabel.hpp +++ b/graph/flow/push-relabel.hpp @@ -5,6 +5,7 @@ #include #include #include + class Stack { private: const int N, H; diff --git a/graph/shortest-path/shortest-nonzero-path.hpp b/graph/shortest-path/shortest-nonzero-path.hpp index 2a886aad..702928df 100644 --- a/graph/shortest-path/shortest-nonzero-path.hpp +++ b/graph/shortest-path/shortest-nonzero-path.hpp @@ -7,6 +7,7 @@ #include #include #include + /** * @brief Shortest Nonzero Path(群ラベル制約付き単一始点最短路) */ diff --git a/graph/tree/static-top-tree.hpp b/graph/tree/static-top-tree.hpp index c744b4ea..7f86833b 100644 --- a/graph/tree/static-top-tree.hpp +++ b/graph/tree/static-top-tree.hpp @@ -5,6 +5,7 @@ #include #include #include + template struct StaticTopTree { enum OpType { Vertex, AddVertex, AddEdge, Rake, Compress }; diff --git a/math/combinatorics/vectorize-mod-int.hpp b/math/combinatorics/vectorize-mod-int.hpp index bbf59838..02246902 100644 --- a/math/combinatorics/vectorize-mod-int.hpp +++ b/math/combinatorics/vectorize-mod-int.hpp @@ -3,6 +3,7 @@ #include #include + #pragma GCC target("avx2") struct alignas(32) VectorizeModInt { diff --git a/math/fps/bell.hpp b/math/fps/bell.hpp index b5e12cf4..c7a771d1 100644 --- a/math/fps/bell.hpp +++ b/math/fps/bell.hpp @@ -1,6 +1,7 @@ #pragma once #include + /** * @brief Bell(ベル数) * diff --git a/math/fps/berlekamp-massey.hpp b/math/fps/berlekamp-massey.hpp index 1553d604..f19efd93 100644 --- a/math/fps/berlekamp-massey.hpp +++ b/math/fps/berlekamp-massey.hpp @@ -1,6 +1,7 @@ #pragma once #include + /** * @brief Berlekamp Massey */ diff --git a/math/fps/coeff-of-rational-function.hpp b/math/fps/coeff-of-rational-function.hpp index 3dde7fef..ead647a4 100644 --- a/math/fps/coeff-of-rational-function.hpp +++ b/math/fps/coeff-of-rational-function.hpp @@ -1,6 +1,7 @@ #pragma once #include + /** * @brief Coeff of Rational Function * diff --git a/math/fps/count-subset-sum.hpp b/math/fps/count-subset-sum.hpp index 48682902..247db074 100644 --- a/math/fps/count-subset-sum.hpp +++ b/math/fps/count-subset-sum.hpp @@ -2,6 +2,7 @@ #include #include + /** * @brief Count Subset Sum */ diff --git a/math/fps/eulerian.hpp b/math/fps/eulerian.hpp index 24b84373..69131c33 100644 --- a/math/fps/eulerian.hpp +++ b/math/fps/eulerian.hpp @@ -2,6 +2,7 @@ #include #include + /** * @brief Eulerian(オイラー数) */ diff --git a/math/fps/sparse-matrix.hpp b/math/fps/sparse-matrix.hpp index e32b8dee..9c3bfc6f 100644 --- a/math/fps/sparse-matrix.hpp +++ b/math/fps/sparse-matrix.hpp @@ -7,6 +7,7 @@ #include #include "formal-power-series.hpp" + template using FPSGraph = std::vector > >; diff --git a/math/fps/stirling-second.hpp b/math/fps/stirling-second.hpp index 46f9fa11..45ad4960 100644 --- a/math/fps/stirling-second.hpp +++ b/math/fps/stirling-second.hpp @@ -1,6 +1,7 @@ #pragma once #include + /** * @brief Stirling Second(第二種スターリング数) */ diff --git a/math/fps/subproduct-tree.hpp b/math/fps/subproduct-tree.hpp index d277b5a5..1f6acbb6 100644 --- a/math/fps/subproduct-tree.hpp +++ b/math/fps/subproduct-tree.hpp @@ -1,6 +1,7 @@ #pragma once #include + /** * @brief Subproduct Tree */ diff --git a/string/palindromic-tree.hpp b/string/palindromic-tree.hpp index 9eb1c8f6..7e585bea 100644 --- a/string/palindromic-tree.hpp +++ b/string/palindromic-tree.hpp @@ -3,6 +3,7 @@ #include #include #include + /** * @brief Palindromic Tree(回文木) * @see https://math314.hateblo.jp/entry/2016/12/19/005919 diff --git a/string/suffix-array.hpp b/string/suffix-array.hpp index 1100c8f9..7b59c019 100644 --- a/string/suffix-array.hpp +++ b/string/suffix-array.hpp @@ -8,6 +8,7 @@ #include #include #include + /** * @brief Suffix Array(接尾辞配列) */ diff --git a/structure/bbst/lazy-red-black-tree.hpp b/structure/bbst/lazy-red-black-tree.hpp index 760f89db..84a0c88d 100644 --- a/structure/bbst/lazy-red-black-tree.hpp +++ b/structure/bbst/lazy-red-black-tree.hpp @@ -8,6 +8,7 @@ #include #include "../../other/vector-pool.hpp" + /** * @brief Lazy-Red-Black-Tree(遅延伝搬赤黒木) * diff --git a/structure/bbst/lazy-reversible-splay-tree.hpp b/structure/bbst/lazy-reversible-splay-tree.hpp index 3fd039be..c12dc2f9 100644 --- a/structure/bbst/lazy-reversible-splay-tree.hpp +++ b/structure/bbst/lazy-reversible-splay-tree.hpp @@ -5,6 +5,7 @@ #include #include #include + /** * @brief Lazy-Reversible-Splay-Tree(遅延伝搬反転可能Splay木) */ diff --git a/structure/bbst/lazy-weight-balanced-tree.hpp b/structure/bbst/lazy-weight-balanced-tree.hpp index f5ccb00d..a66782fb 100644 --- a/structure/bbst/lazy-weight-balanced-tree.hpp +++ b/structure/bbst/lazy-weight-balanced-tree.hpp @@ -8,6 +8,7 @@ #include #include "../../other/vector-pool.hpp" + /** * @brief Lazy-Weight-Balanced-Tree(遅延伝搬重み平衡木) */ diff --git a/structure/bbst/persistent-lazy-red-black-tree.hpp b/structure/bbst/persistent-lazy-red-black-tree.hpp index 8dba169e..46d4732d 100644 --- a/structure/bbst/persistent-lazy-red-black-tree.hpp +++ b/structure/bbst/persistent-lazy-red-black-tree.hpp @@ -3,6 +3,7 @@ #include #include "lazy-red-black-tree.hpp" + template struct PersistentLazyRedBlackTree diff --git a/structure/bbst/persistent-lazy-weight-balanced-tree.hpp b/structure/bbst/persistent-lazy-weight-balanced-tree.hpp index 1f145296..38e050d9 100644 --- a/structure/bbst/persistent-lazy-weight-balanced-tree.hpp +++ b/structure/bbst/persistent-lazy-weight-balanced-tree.hpp @@ -3,6 +3,7 @@ #include #include "lazy-weight-balanced-tree.hpp" + /** * @brief Persistent-Lazy-Weight-Balanced-Tree(永続遅延伝搬重み平衡木) */ diff --git a/structure/bbst/persistent-red-black-tree.hpp b/structure/bbst/persistent-red-black-tree.hpp index 7520e31a..d9d58be2 100644 --- a/structure/bbst/persistent-red-black-tree.hpp +++ b/structure/bbst/persistent-red-black-tree.hpp @@ -3,6 +3,7 @@ #include #include "red-black-tree.hpp" + template struct PersistentRedBlackTree : RedBlackTree { using RBT = RedBlackTree; diff --git a/structure/bbst/persistent-weight-balanced-tree.hpp b/structure/bbst/persistent-weight-balanced-tree.hpp index e39e816e..6e7285ce 100644 --- a/structure/bbst/persistent-weight-balanced-tree.hpp +++ b/structure/bbst/persistent-weight-balanced-tree.hpp @@ -3,6 +3,7 @@ #include #include "weight-balanced-tree.hpp" + /** * @brief Persistent-Weight-Balanced-Tree(永続重み平衡木) */ diff --git a/structure/bbst/randomized-binary-search-tree-lazy.hpp b/structure/bbst/randomized-binary-search-tree-lazy.hpp index 8ecdd214..ec8eaed3 100644 --- a/structure/bbst/randomized-binary-search-tree-lazy.hpp +++ b/structure/bbst/randomized-binary-search-tree-lazy.hpp @@ -6,6 +6,7 @@ #include #include #include + template struct RandomizedBinarySearchTree { using F = std::function; diff --git a/structure/bbst/randomized-binary-search-tree-set.hpp b/structure/bbst/randomized-binary-search-tree-set.hpp index 63f64329..87e6ee2f 100644 --- a/structure/bbst/randomized-binary-search-tree-set.hpp +++ b/structure/bbst/randomized-binary-search-tree-set.hpp @@ -3,6 +3,7 @@ #include #include "randomized-binary-search-tree.hpp" + template struct OrderedMultiSet : RandomizedBinarySearchTree { using RBST = RandomizedBinarySearchTree; diff --git a/structure/bbst/randomized-binary-search-tree.hpp b/structure/bbst/randomized-binary-search-tree.hpp index 7dce3fd9..cd9095a9 100644 --- a/structure/bbst/randomized-binary-search-tree.hpp +++ b/structure/bbst/randomized-binary-search-tree.hpp @@ -7,6 +7,7 @@ #include #include #include + template class RandomizedBinarySearchTree { using F = std::function; diff --git a/structure/bbst/red-black-tree.hpp b/structure/bbst/red-black-tree.hpp index 4909b06f..4301ef23 100644 --- a/structure/bbst/red-black-tree.hpp +++ b/structure/bbst/red-black-tree.hpp @@ -8,6 +8,7 @@ #include #include "../../other/vector-pool.hpp" + /** * @brief Red-Black-Tree(赤黒木) * diff --git a/structure/bbst/reversible-splay-tree.hpp b/structure/bbst/reversible-splay-tree.hpp index 5fe4c38c..8941e3d7 100644 --- a/structure/bbst/reversible-splay-tree.hpp +++ b/structure/bbst/reversible-splay-tree.hpp @@ -5,6 +5,7 @@ #include #include #include + /** * @brief Reversible-Splay-Tree(反転可能Splay木) */ diff --git a/structure/bbst/weight-balanced-tree.hpp b/structure/bbst/weight-balanced-tree.hpp index c32f9945..12e2c272 100644 --- a/structure/bbst/weight-balanced-tree.hpp +++ b/structure/bbst/weight-balanced-tree.hpp @@ -8,6 +8,7 @@ #include #include "../../other/vector-pool.hpp" + /** * @brief Weight-Balanced-Tree(重み平衡木) */ diff --git a/structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp b/structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp index 47072100..872b4cbb 100644 --- a/structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp +++ b/structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp @@ -4,6 +4,7 @@ #include #include #include + template struct ConvexHullTrickAddMonotone { #define F first diff --git a/structure/convex-hull-trick/dynamic-li-chao-tree.hpp b/structure/convex-hull-trick/dynamic-li-chao-tree.hpp index 1c8b1b23..fb7445a2 100644 --- a/structure/convex-hull-trick/dynamic-li-chao-tree.hpp +++ b/structure/convex-hull-trick/dynamic-li-chao-tree.hpp @@ -2,6 +2,7 @@ #include #include + /** * @brief Dynamic-Li-Chao-Tree * diff --git a/structure/convex-hull-trick/li-chao-tree.hpp b/structure/convex-hull-trick/li-chao-tree.hpp index 88475446..dd6109e9 100644 --- a/structure/convex-hull-trick/li-chao-tree.hpp +++ b/structure/convex-hull-trick/li-chao-tree.hpp @@ -4,6 +4,7 @@ #include #include #include + template struct LiChaoTree { struct Line { diff --git a/structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp b/structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp index f0f9f7d5..8ec3dfcb 100644 --- a/structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp +++ b/structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp @@ -2,6 +2,7 @@ #include #include + template struct PersistentDynamicLiChaoTree { struct Line { diff --git a/structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp b/structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp index 8958ae72..75c9aa37 100644 --- a/structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp +++ b/structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp @@ -3,6 +3,7 @@ #include #include #include + template