template/util.hpp
- View this file on GitHub
- Last update: 2024-05-03 23:21:26+09:00
- Include:
#include "template/util.hpp"
Required by
無平方数の数え上げ (multiplicative-function/count-square-free.hpp)
乗法的関数の列挙 (multiplicative-function/enamurate-multiplicative-function.hpp)
有名な乗法的関数 (multiplicative-function/mf-famous-series.hpp)
AND Convoluion (set-function/and-convolution.hpp)
OR Convoluion (set-function/or-convolution.hpp)
XOR Convoluion (set-function/xor-convolution.hpp)
template/template.hpp
Verified with
verify/verify-aoj-alds/verify-aoj-alds-14-c.test.cpp
verify/verify-aoj-cgl/aoj-cgl-1-a.test.cpp
verify/verify-aoj-cgl/aoj-cgl-1-b.test.cpp
verify/verify-aoj-cgl/aoj-cgl-1-c.test.cpp
verify/verify-aoj-cgl/aoj-cgl-2-a.test.cpp
verify/verify-aoj-cgl/aoj-cgl-2-b.test.cpp
verify/verify-aoj-cgl/aoj-cgl-2-c.test.cpp
verify/verify-aoj-cgl/aoj-cgl-2-d.test.cpp
verify/verify-aoj-cgl/aoj-cgl-3-a.test.cpp
verify/verify-aoj-cgl/aoj-cgl-3-b.test.cpp
verify/verify-aoj-cgl/aoj-cgl-3-c.test.cpp
verify/verify-aoj-cgl/aoj-cgl-4-a.test.cpp
verify/verify-aoj-cgl/aoj-cgl-4-b.test.cpp
verify/verify-aoj-cgl/aoj-cgl-4-c.test.cpp
verify/verify-aoj-dpl/aoj-dpl-1-b.test.cpp
verify/verify-aoj-dpl/aoj-dpl-1-f-bandb.test.cpp
verify/verify-aoj-dpl/aoj-dpl-1-f.test.cpp
verify/verify-aoj-dpl/aoj-dpl-1-h-bandb.test.cpp
verify/verify-aoj-dpl/aoj-dpl-1-h.test.cpp
verify/verify-aoj-dpl/aoj-dpl-3-c.test.cpp
verify/verify-aoj-dsl/aoj-dsl-1-a-dynamic.test.cpp
verify/verify-aoj-dsl/aoj-dsl-1-a.test.cpp
verify/verify-aoj-dsl/aoj-dsl-1-b.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-a-segtree.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-b-bit.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-b-segtree.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-d.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-e-imos.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-e.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-f-max.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-f.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-g-bit.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-g.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-h-max.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-h.test.cpp
verify/verify-aoj-dsl/aoj-dsl-2-i.test.cpp
verify/verify-aoj-dsl/aoj-dsl-3-d-cartesiantree.test.cpp
verify/verify-aoj-dsl/aoj-dsl-3-d.test.cpp
verify/verify-aoj-dsl/aoj-dsl-5-b-2dseg.test.cpp
verify/verify-aoj-dsl/aoj-dsl-5-b-bit2d.test.cpp
verify/verify-aoj-dsl/aoj-dsl-5-b.test.cpp
verify/verify-aoj-grl/aoj-grl-1-a-fast-dijkstra.test.cpp
verify/verify-aoj-grl/aoj-grl-1-a-radix-heap.test.cpp
verify/verify-aoj-grl/aoj-grl-1-a.test.cpp
verify/verify-aoj-grl/aoj-grl-1-b.test.cpp
verify/verify-aoj-grl/aoj-grl-1-c.test.cpp
verify/verify-aoj-grl/aoj-grl-2-a.test.cpp
verify/verify-aoj-grl/aoj-grl-3-a.test.cpp
verify/verify-aoj-grl/aoj-grl-3-b.test.cpp
verify/verify-aoj-grl/aoj-grl-3-c.test.cpp
verify/verify-aoj-grl/aoj-grl-4-a.test.cpp
verify/verify-aoj-grl/aoj-grl-4-b.test.cpp
verify/verify-aoj-grl/aoj-grl-5-a-dynamic-rerooting.test.cpp
verify/verify-aoj-grl/aoj-grl-5-a-rerooting.test.cpp
verify/verify-aoj-grl/aoj-grl-5-a.test.cpp
verify/verify-aoj-grl/aoj-grl-5-b.test.cpp
verify/verify-aoj-grl/aoj-grl-5-c.test.cpp
verify/verify-aoj-grl/aoj-grl-5-d.test.cpp
verify/verify-aoj-grl/aoj-grl-5-e.test.cpp
verify/verify-aoj-itp/aoj-itp2-11-b.test.cpp
verify/verify-aoj-itp/aoj-itp2-11-c.test.cpp
verify/verify-aoj-ntl/aoj-ntl-1-a.test.cpp
verify/verify-aoj-ntl/aoj-ntl-1-b.test.cpp
verify/verify-aoj-ntl/aoj-ntl-1-c.test.cpp
verify/verify-aoj-ntl/aoj-ntl-1-d.test.cpp
verify/verify-aoj-ntl/aoj-ntl-1-e.test.cpp
verify/verify-aoj-other/aoj-0304.test.cpp
verify/verify-aoj-other/aoj-0412.test.cpp
verify/verify-aoj-other/aoj-1068.test.cpp
verify/verify-aoj-other/aoj-1130-DG-bfs.test.cpp
verify/verify-aoj-other/aoj-1377.test.cpp
verify/verify-aoj-other/aoj-1613.test.cpp
verify/verify-aoj-other/aoj-2171-bigrational.test.cpp
verify/verify-aoj-other/aoj-2171.test.cpp
verify/verify-aoj-other/aoj-2821.test.cpp
verify/verify-aoj-other/aoj-2891-2.test.cpp
verify/verify-aoj-other/aoj-2891.test.cpp
verify/verify-aoj-other/aoj-2945-01bfs.test.cpp
verify/verify-aoj-other/aoj-2945-DG-01bfs.test.cpp
verify/verify-aoj-other/aoj-2995-hashmap.test.cpp
verify/verify-aoj-other/aoj-2995.test.cpp
verify/verify-aoj-other/aoj-3022.test.cpp
verify/verify-aoj-other/aoj-3086.test.cpp
verify/verify-aoj-other/aoj-3277.test.cpp
verify/verify-aoj-other/aoj-3506.test.cpp
verify/verify-unit-test/arbitrary-modint.test.cpp
verify/verify-unit-test/arbitrary-ntt-mod18446744069414584321.test.cpp
verify/verify-unit-test/barrett-reduction.test.cpp
verify/verify-unit-test/bigint-gcd.test.cpp
verify/verify-unit-test/bigint.test.cpp
verify/verify-unit-test/bigint2.test.cpp
verify/verify-unit-test/bigint3.test.cpp
verify/verify-unit-test/bigrational.test.cpp
verify/verify-unit-test/binomial-table.test.cpp
verify/verify-unit-test/bitset-find-prev.test.cpp
verify/verify-unit-test/complex-fft.test.cpp
verify/verify-unit-test/composite-exp.test.cpp
verify/verify-unit-test/composition.test.cpp
verify/verify-unit-test/debug.test.cpp
verify/verify-unit-test/dijkstra.test.cpp
verify/verify-unit-test/dual-fps.test.cpp
verify/verify-unit-test/dynamic-diameter.test.cpp
verify/verify-unit-test/enumerate-convex.test.cpp
verify/verify-unit-test/enumerate-quotient.test.cpp
verify/verify-unit-test/erasable-priority-queue.test.cpp
verify/verify-unit-test/factorize.test.cpp
verify/verify-unit-test/fast-bs.test.cpp
verify/verify-unit-test/fast-inv-o1.test.cpp
verify/verify-unit-test/fast-inv.test.cpp
verify/verify-unit-test/fft2d.test.cpp
verify/verify-unit-test/fps-sparse.test.cpp
verify/verify-unit-test/fps.test.cpp
verify/verify-unit-test/garner-bigint.test.cpp
verify/verify-unit-test/garner.test.cpp
verify/verify-unit-test/gauss-elimination.test.cpp
verify/verify-unit-test/geometry.test.cpp
verify/verify-unit-test/hashmap.test.cpp
verify/verify-unit-test/hashset.test.cpp
verify/verify-unit-test/inner-hash.test.cpp
verify/verify-unit-test/int-div.test.cpp
verify/verify-unit-test/internal-math.test.cpp
verify/verify-unit-test/internal-type-traits.test.cpp
verify/verify-unit-test/interval-union.test.cpp
verify/verify-unit-test/karatsuba.test.cpp
verify/verify-unit-test/lazyseg-bsearch.test.cpp
verify/verify-unit-test/lazyseg-setval-2.test.cpp
verify/verify-unit-test/lazyseg-setval.test.cpp
verify/verify-unit-test/li-chao-tree-abstruct.test.cpp
verify/verify-unit-test/manacher.test.cpp
verify/verify-unit-test/math-fast-2.test.cpp
verify/verify-unit-test/math-fast.test.cpp
verify/verify-unit-test/math.test.cpp
verify/verify-unit-test/mf.test.cpp
verify/verify-unit-test/modint-2-61m1.test.cpp
verify/verify-unit-test/modint.test.cpp
verify/verify-unit-test/multieval.test.cpp
verify/verify-unit-test/multiplicative-function.test.cpp
verify/verify-unit-test/multipoint-binomial-sum.test.cpp
verify/verify-unit-test/nimber-to-field.test.cpp
verify/verify-unit-test/nimber.test.cpp
verify/verify-unit-test/ntt-64bit.test.cpp
verify/verify-unit-test/orderedmap.test.cpp
verify/verify-unit-test/osak.test.cpp
verify/verify-unit-test/p-recursive.test.cpp
verify/verify-unit-test/parallel-union-find.test.cpp
verify/verify-unit-test/partial-fraction-decomposition.test.cpp
verify/verify-unit-test/polynomial-matrix-prod.test.cpp
verify/verify-unit-test/primality-test.test.cpp
verify/verify-unit-test/primitive-root.test.cpp
verify/verify-unit-test/radix-heap.test.cpp
verify/verify-unit-test/radix-sort.test.cpp
verify/verify-unit-test/rational-number.test.cpp
verify/verify-unit-test/rbst-segment-tree.test.cpp
verify/verify-unit-test/rbst-sequence.test.cpp
verify/verify-unit-test/relaxed-convolution.test.cpp
verify/verify-unit-test/rerooting.test.cpp
verify/verify-unit-test/run-length-encoding.test.cpp
verify/verify-unit-test/sa-manager.test.cpp
verify/verify-unit-test/segment-set.test.cpp
verify/verify-unit-test/segment-tree-beats.test.cpp
verify/verify-unit-test/semiring.test.cpp
verify/verify-unit-test/set-function.test.cpp
verify/verify-unit-test/simulated-annealing.test.cpp
verify/verify-unit-test/sparse-table.test.cpp
verify/verify-unit-test/stirling-matrix.test.cpp
verify/verify-unit-test/strassen.test.cpp
verify/verify-unit-test/string-search.test.cpp
verify/verify-unit-test/sum-of-mf.test.cpp
verify/verify-unit-test/template.test.cpp
verify/verify-unit-test/tree-path.test.cpp
verify/verify-unit-test/wavelet-matrix.test.cpp
verify/verify-yosupo-ds/yosupo-associative-array-dynamic-segtree.test.cpp
verify/verify-yosupo-ds/yosupo-associative-array-rbstseg.test.cpp
verify/verify-yosupo-ds/yosupo-associative-array-unerasable-hashmap.test.cpp
verify/verify-yosupo-ds/yosupo-binary-trie.test.cpp
verify/verify-yosupo-ds/yosupo-deque-operate-all-composite.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-li-chao-tree.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-sequence-range-affine-range-sum-splay.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-sequence-range-affine-range-sum-treap.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-sequence-range-affine-range-sum.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-tree-subtree-add-subtree-sum.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-add-path-sum.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-add-subtree-sum-2.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-add-subtree-sum.test.cpp
verify/verify-yosupo-ds/yosupo-dynamic-tree-vertex-set-path-composite.test.cpp
verify/verify-yosupo-ds/yosupo-hash-map-variable-length.test.cpp
verify/verify-yosupo-ds/yosupo-hashmap.test.cpp
verify/verify-yosupo-ds/yosupo-lazysegtree-2.test.cpp
verify/verify-yosupo-ds/yosupo-lazysegtree.test.cpp
verify/verify-yosupo-ds/yosupo-line-add-get-min.test.cpp
verify/verify-yosupo-ds/yosupo-offline-dynamic-connectivity.test.cpp
verify/verify-yosupo-ds/yosupo-orderedmap.test.cpp
verify/verify-yosupo-ds/yosupo-persistent-queue.test.cpp
verify/verify-yosupo-ds/yosupo-persistent-unionfind.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-range-sum-dynamic-segtree.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-range-sum.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-abstruct-range-tree.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-bit2d.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-dseg2d.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-rtree-fenwick.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-segtree-on-wm.test.cpp
verify/verify-yosupo-ds/yosupo-point-add-rectangle-sum-wm.test.cpp
verify/verify-yosupo-ds/yosupo-point-set-range-composite-dynamic-segtree.test.cpp
verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg.test.cpp
verify/verify-yosupo-ds/yosupo-point-set-range-composite-rbstseg2.test.cpp
verify/verify-yosupo-ds/yosupo-precedessor-problem-segtree.test.cpp
verify/verify-yosupo-ds/yosupo-predecessor-problem-vEB-tree.test.cpp
verify/verify-yosupo-ds/yosupo-predecessor-problem.test.cpp
verify/verify-yosupo-ds/yosupo-procedessor-problem-rbstseg.test.cpp
verify/verify-yosupo-ds/yosupo-range-add-range-sum-linkcuttree.test.cpp
verify/verify-yosupo-ds/yosupo-range-affine-point-get-2.test.cpp
verify/verify-yosupo-ds/yosupo-range-affine-point-get.test.cpp
verify/verify-yosupo-ds/yosupo-range-affine-range-sum-dynamic-segtree.test.cpp
verify/verify-yosupo-ds/yosupo-range-affine-range-sum-rbstseg.test.cpp
verify/verify-yosupo-ds/yosupo-range-affine-sqdec.test.cpp
verify/verify-yosupo-ds/yosupo-range-parallel-unionfind.test.cpp
verify/verify-yosupo-ds/yosupo-range-reverse-range-sum.test.cpp
verify/verify-yosupo-ds/yosupo-range-set-range-composite.test.cpp
verify/verify-yosupo-ds/yosupo-rectangle-sum.test.cpp
verify/verify-yosupo-ds/yosupo-rollback-union-find.test.cpp
verify/verify-yosupo-ds/yosupo-segment-add-get-min.test.cpp
verify/verify-yosupo-ds/yosupo-segtree-beats.test.cpp
verify/verify-yosupo-ds/yosupo-static-range-inversion-query-2.test.cpp
verify/verify-yosupo-ds/yosupo-static-range-inversions-query.test.cpp
verify/verify-yosupo-ds/yosupo-static-rectangle-add-rectangle-sum.test.cpp
verify/verify-yosupo-ds/yosupo-static-rmq.test.cpp
verify/verify-yosupo-ds/yosupo-swag.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-add-path-sum-euler-tour.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-add-path-sum.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-add-subtree-sum-dst-on-tree.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-add-subtree-sum-euler-tree.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-add-subtree-sum.test.cpp
verify/verify-yosupo-ds/yosupo-vertex-set-path-composite.test.cpp
verify/verify-yosupo-fps/yosupo-composition-fast.test.cpp
verify/verify-yosupo-fps/yosupo-composition-large.test.cpp
verify/verify-yosupo-fps/yosupo-composition.test.cpp
verify/verify-yosupo-fps/yosupo-compositional-inverse-large.test.cpp
verify/verify-yosupo-fps/yosupo-compositional-inverse-newton.test.cpp
verify/verify-yosupo-fps/yosupo-compositional-inverse.test.cpp
verify/verify-yosupo-fps/yosupo-division-of-polynomials.test.cpp
verify/verify-yosupo-fps/yosupo-exp-arb.test.cpp
verify/verify-yosupo-fps/yosupo-exp-newton-method-2.test.cpp
verify/verify-yosupo-fps/yosupo-exp-newton-method.test.cpp
verify/verify-yosupo-fps/yosupo-exp-ofps.test.cpp
verify/verify-yosupo-fps/yosupo-exp-relaxed-convolution.test.cpp
verify/verify-yosupo-fps/yosupo-exp.test.cpp
verify/verify-yosupo-fps/yosupo-factorial-p-recursive.test.cpp
verify/verify-yosupo-fps/yosupo-factorial.test.cpp
verify/verify-yosupo-fps/yosupo-interpolation.test.cpp
verify/verify-yosupo-fps/yosupo-inv-arb.test.cpp
verify/verify-yosupo-fps/yosupo-inv-newton-method.test.cpp
verify/verify-yosupo-fps/yosupo-inv-of-polynomials.test.cpp
verify/verify-yosupo-fps/yosupo-inv-ofps.test.cpp
verify/verify-yosupo-fps/yosupo-inv-relaxed-convolution.test.cpp
verify/verify-yosupo-fps/yosupo-inv.test.cpp
verify/verify-yosupo-fps/yosupo-linear-recurrence.test.cpp
verify/verify-yosupo-fps/yosupo-log-arb.test.cpp
verify/verify-yosupo-fps/yosupo-log.test.cpp
verify/verify-yosupo-fps/yosupo-multieval-fast.test.cpp
verify/verify-yosupo-fps/yosupo-multieval.test.cpp
verify/verify-yosupo-fps/yosupo-polynomial-interpolation-fast.test.cpp
verify/verify-yosupo-fps/yosupo-polynomial-root-finding.test.cpp
verify/verify-yosupo-fps/yosupo-pow-arb.test.cpp
verify/verify-yosupo-fps/yosupo-pow.test.cpp
verify/verify-yosupo-fps/yosupo-product-of-polynomial-sequence.test.cpp
verify/verify-yosupo-fps/yosupo-sample-point-shift.test.cpp
verify/verify-yosupo-fps/yosupo-sparse-exp.test.cpp
verify/verify-yosupo-fps/yosupo-sparse-inv.test.cpp
verify/verify-yosupo-fps/yosupo-sparse-log.test.cpp
verify/verify-yosupo-fps/yosupo-sparse-pow.test.cpp
verify/verify-yosupo-fps/yosupo-sqrt.test.cpp
verify/verify-yosupo-fps/yosupo-stirling-1st-row.test.cpp
verify/verify-yosupo-fps/yosupo-stirling-1st.test.cpp
verify/verify-yosupo-fps/yosupo-stirling-2nd-row.test.cpp
verify/verify-yosupo-fps/yosupo-stirling-2nd.test.cpp
verify/verify-yosupo-fps/yosupo-sum-of-exp-poly-limit.test.cpp
verify/verify-yosupo-fps/yosupo-sum-of-exp-poly.test.cpp
verify/verify-yosupo-fps/yosupo-taylor-shift.test.cpp
verify/verify-yosupo-graph/yosupo-cartesian.test.cpp
verify/verify-yosupo-graph/yosupo-chromatic-number.test.cpp
verify/verify-yosupo-graph/yosupo-cycle-detection.test.cpp
verify/verify-yosupo-graph/yosupo-diameter.test.cpp
verify/verify-yosupo-graph/yosupo-directed-mst.test.cpp
verify/verify-yosupo-graph/yosupo-exp-of-set-power-series.test.cpp
verify/verify-yosupo-graph/yosupo-frequency-table-of-tree-distance.test.cpp
verify/verify-yosupo-graph/yosupo-jump-on-tree.test.cpp
verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-doubling.test.cpp
verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-euler-tour.test.cpp
verify/verify-yosupo-graph/yosupo-lowest-common-ancestor-tree-util.test.cpp
verify/verify-yosupo-graph/yosupo-lowest-common-ancestor.test.cpp
verify/verify-yosupo-graph/yosupo-matching-on-bipartite-graph.test.cpp
verify/verify-yosupo-graph/yosupo-max-independent-set.test.cpp
verify/verify-yosupo-graph/yosupo-point-set-tree-path-composite-sum-fixed-root-2.test.cpp
verify/verify-yosupo-graph/yosupo-point-set-tree-path-composite-sum-fixed-root.test.cpp
verify/verify-yosupo-graph/yosupo-point-set-tree-path-composite-sum.test.cpp
verify/verify-yosupo-graph/yosupo-scc-atcoder.test.cpp
verify/verify-yosupo-graph/yosupo-shortest-path-2.test.cpp
verify/verify-yosupo-graph/yosupo-shortest-path-3.test.cpp
verify/verify-yosupo-graph/yosupo-shortest-path-4.test.cpp
verify/verify-yosupo-graph/yosupo-shortest-path-dijkstra-abstruct.test.cpp
verify/verify-yosupo-graph/yosupo-shortest-path.test.cpp
verify/verify-yosupo-graph/yosupo-strongly-connected-components.test.cpp
verify/verify-yosupo-graph/yosupo-tree-hash.test.cpp
verify/verify-yosupo-graph/yosupo-tree-path-composite-sum.test.cpp
verify/verify-yosupo-graph/yosupo-two-edge-cc.test.cpp
verify/verify-yosupo-math/yosupo-addition-of-big-integers.test.cpp
verify/verify-yosupo-math/yosupo-addition-of-hex.test.cpp
verify/verify-yosupo-math/yosupo-binomial-coefficient-large.test.cpp
verify/verify-yosupo-math/yosupo-binomial-coefficient-prime-mod.test.cpp
verify/verify-yosupo-math/yosupo-binomial-coefficient.test.cpp
verify/verify-yosupo-math/yosupo-characteristic-polynomial.test.cpp
verify/verify-yosupo-math/yosupo-concave-min-plus-convolution-1.test.cpp
verify/verify-yosupo-math/yosupo-concave-min-plus-convolution-2.test.cpp
verify/verify-yosupo-math/yosupo-concave-min-plus-convolution-3.test.cpp
verify/verify-yosupo-math/yosupo-concave-min-plus-convolution-4.test.cpp
verify/verify-yosupo-math/yosupo-count-squarefrees.test.cpp
verify/verify-yosupo-math/yosupo-counting-primes-2.test.cpp
verify/verify-yosupo-math/yosupo-counting-primes-3.test.cpp
verify/verify-yosupo-math/yosupo-counting-primes-4.test.cpp
verify/verify-yosupo-math/yosupo-counting-primes.test.cpp
verify/verify-yosupo-math/yosupo-determinant-arbitrary-mod.test.cpp
verify/verify-yosupo-math/yosupo-determinant-matrixlib.test.cpp
verify/verify-yosupo-math/yosupo-determinant-of-matrix-bbla.test.cpp
verify/verify-yosupo-math/yosupo-determinant-of-matrix-mod-2.test.cpp
verify/verify-yosupo-math/yosupo-determinant-of-sparse-matrix-bbla.test.cpp
verify/verify-yosupo-math/yosupo-determinant.test.cpp
verify/verify-yosupo-math/yosupo-division-of-big-integers.test.cpp
verify/verify-yosupo-math/yosupo-division-of-hex.test.cpp
verify/verify-yosupo-math/yosupo-enumerate-quotient.test.cpp
verify/verify-yosupo-math/yosupo-factorization.test.cpp
verify/verify-yosupo-math/yosupo-gcd-convolution.test.cpp
verify/verify-yosupo-math/yosupo-gcd-of-gaussian-integer.test.cpp
verify/verify-yosupo-math/yosupo-hafnian-of-matrix.test.cpp
verify/verify-yosupo-math/yosupo-inverse-matrix-mod-2.test.cpp
verify/verify-yosupo-math/yosupo-inverse-matrix.test.cpp
verify/verify-yosupo-math/yosupo-kth-root-integral.test.cpp
verify/verify-yosupo-math/yosupo-kth-root-mod.test.cpp
verify/verify-yosupo-math/yosupo-lcm-convolution.test.cpp
verify/verify-yosupo-math/yosupo-linear-equation-2.test.cpp
verify/verify-yosupo-math/yosupo-linear-equation.test.cpp
verify/verify-yosupo-math/yosupo-longest-increasing-sequence.test.cpp
verify/verify-yosupo-math/yosupo-matrix-product-mod-2.test.cpp
verify/verify-yosupo-math/yosupo-matrix-product-strassen.test.cpp
verify/verify-yosupo-math/yosupo-mod-log.test.cpp
verify/verify-yosupo-math/yosupo-mod-sqrt.test.cpp
verify/verify-yosupo-math/yosupo-multiplication-of-big-integers.test.cpp
verify/verify-yosupo-math/yosupo-multiplication-of-hex.test.cpp
verify/verify-yosupo-math/yosupo-nim-product.test.cpp
verify/verify-yosupo-math/yosupo-polynomial-composite-set-power-series.test.cpp
verify/verify-yosupo-math/yosupo-pow-of-matrix-2.test.cpp
verify/verify-yosupo-math/yosupo-pow-of-matrix.test.cpp
verify/verify-yosupo-math/yosupo-primality-test-u64.test.cpp
verify/verify-yosupo-math/yosupo-primality-test.test.cpp
verify/verify-yosupo-math/yosupo-prime-enumerate-sieve.test.cpp
verify/verify-yosupo-math/yosupo-prime-table.test.cpp
verify/verify-yosupo-math/yosupo-primitive-root.test.cpp
verify/verify-yosupo-math/yosupo-rank-of-matrix.test.cpp
verify/verify-yosupo-math/yosupo-rational-approximation.test.cpp
verify/verify-yosupo-math/yosupo-sparse-determinant.test.cpp
verify/verify-yosupo-math/yosupo-stern-brocot-tree-2.test.cpp
verify/verify-yosupo-math/yosupo-stern-brocot-tree.test.cpp
verify/verify-yosupo-math/yosupo-subset-convolution.test.cpp
verify/verify-yosupo-math/yosupo-sum-of-floor.test.cpp
verify/verify-yosupo-math/yosupo-sum-of-totient-2.test.cpp
verify/verify-yosupo-math/yosupo-sum-of-totient-3.test.cpp
verify/verify-yosupo-math/yosupo-sum-of-totient.test.cpp
verify/verify-yosupo-math/yosupo-tetration-mod.test.cpp
verify/verify-yosupo-math/yosupo-two-sat-atcoder.test.cpp
verify/verify-yosupo-math/yosupo-two-sat.test.cpp
verify/verify-yosupo-math/yosupo-two-square-sum.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-2-64-karatsuba.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-arbitrarylengthntt.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-arbitraryntt-arbitrarymodint.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-arbitraryntt-arbitraryprimemodint.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-arbitraryntt.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-chirp-z.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-large.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-ntt-avx2.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-ntt-normalmodint.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-ntt-sse42.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-ntt.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-on-z-pz.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-real-fft-15bit.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-real-fft-toom-3.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-relaxed-convolution.test.cpp
verify/verify-yosupo-ntt/yosupo-convolution-schoenhage-radix2.test.cpp
verify/verify-yosupo-ntt/yosupo-inliner-multiply.test.cpp
verify/verify-yosupo-ntt/yosupo-multiplicative-convolution.test.cpp
verify/verify-yosupo-ntt/yosupo-multipoint-evaluation-chirp-z.test.cpp
verify/verify-yosupo-ntt/yosupo-multivariate-circular-convolution.test.cpp
verify/verify-yosupo-other/yosupo-a-plus-b-128bit-bigint.test.cpp
verify/verify-yosupo-other/yosupo-a-plus-b-128bit-fastio.test.cpp
verify/verify-yosupo-other/yosupo-a-plus-b-128bit.test.cpp
verify/verify-yosupo-other/yosupo-a-plus-b.test.cpp
verify/verify-yosupo-other/yosupo-argument-sort.test.cpp
verify/verify-yosupo-other/yosupo-many-a-plus-b.test.cpp
verify/verify-yosupo-other/yosupo-static-convex-hull-2.test.cpp
verify/verify-yosupo-other/yosupo-static-convex-hull.test.cpp
verify/verify-yosupo-string/yosupo-enumerate-palindromes-roriha.test.cpp
verify/verify-yosupo-string/yosupo-number-of-subsequences.test.cpp
verify/verify-yosupo-string/yosupo-number-of-substrings-suffixautomaton.test.cpp
verify/verify-yosupo-string/yosupo-number-of-substrings.test.cpp
verify/verify-yosupo-string/yosupo-run-enumerate.test.cpp
verify/verify-yosupo-string/yosupo-suffix-array.test.cpp
verify/verify-yosupo-string/yosupo-wildcard-pattern-matching.test.cpp
verify/verify-yosupo-string/yosupo-z-algorithm.test.cpp
verify/verify-yosupo-string/yosupo-zalgo-rollinghash.test.cpp
verify/verify-yosupo-string/yosupo-zalgo-suffixarray.test.cpp
verify/verify-yuki/yuki-0002.test.cpp
verify/verify-yuki/yuki-0102.test.cpp
verify/verify-yuki/yuki-0103.test.cpp
verify/verify-yuki/yuki-0117.test.cpp
verify/verify-yuki/yuki-0125.test.cpp
verify/verify-yuki/yuki-0214.test.cpp
verify/verify-yuki/yuki-0215-nth-term.test.cpp
verify/verify-yuki/yuki-0215.test.cpp
verify/verify-yuki/yuki-0303.test.cpp
verify/verify-yuki/yuki-0361.test.cpp
verify/verify-yuki/yuki-0430-2.test.cpp
verify/verify-yuki/yuki-0430.test.cpp
verify/verify-yuki/yuki-0502.test.cpp
verify/verify-yuki/yuki-0697.test.cpp
verify/verify-yuki/yuki-0703.test.cpp
verify/verify-yuki/yuki-0704.test.cpp
verify/verify-yuki/yuki-0705.test.cpp
verify/verify-yuki/yuki-0720.test.cpp
verify/verify-yuki/yuki-0768.test.cpp
verify/verify-yuki/yuki-0789.test.cpp
verify/verify-yuki/yuki-0875-binary-search-on-segtree.test.cpp
verify/verify-yuki/yuki-0879.test.cpp
verify/verify-yuki/yuki-0880.test.cpp
verify/verify-yuki/yuki-0886.test.cpp
verify/verify-yuki/yuki-0890.test.cpp
verify/verify-yuki/yuki-0896.test.cpp
verify/verify-yuki/yuki-0952.test.cpp
verify/verify-yuki/yuki-0963-circular.test.cpp
verify/verify-yuki/yuki-0963.test.cpp
verify/verify-yuki/yuki-1080.test.cpp
verify/verify-yuki/yuki-1112-sparse.test.cpp
verify/verify-yuki/yuki-1112.test.cpp
verify/verify-yuki/yuki-1115.test.cpp
verify/verify-yuki/yuki-1145-frac.test.cpp
verify/verify-yuki/yuki-1145.test.cpp
verify/verify-yuki/yuki-1170-divide-interval.test.cpp
verify/verify-yuki/yuki-1170.test.cpp
verify/verify-yuki/yuki-1220.test.cpp
verify/verify-yuki/yuki-1254-2.test.cpp
verify/verify-yuki/yuki-1254.test.cpp
verify/verify-yuki/yuki-1269.test.cpp
verify/verify-yuki/yuki-1283.test.cpp
verify/verify-yuki/yuki-1303.test.cpp
verify/verify-yuki/yuki-1320.test.cpp
verify/verify-yuki/yuki-1323.test.cpp
verify/verify-yuki/yuki-1326.test.cpp
verify/verify-yuki/yuki-1340-bitmatrix.test.cpp
verify/verify-yuki/yuki-1340-semiring.test.cpp
verify/verify-yuki/yuki-1460.test.cpp
verify/verify-yuki/yuki-1467-weighted.test.cpp
verify/verify-yuki/yuki-1467.test.cpp
verify/verify-yuki/yuki-1504.test.cpp
verify/verify-yuki/yuki-1510.test.cpp
verify/verify-yuki/yuki-1533.test.cpp
verify/verify-yuki/yuki-1775.test.cpp
verify/verify-yuki/yuki-1777.test.cpp
verify/verify-yuki/yuki-1778.test.cpp
verify/verify-yuki/yuki-1781.test.cpp
verify/verify-yuki/yuki-1783.test.cpp
verify/verify-yuki/yuki-1786.test.cpp
verify/verify-yuki/yuki-1787.test.cpp
verify/verify-yuki/yuki-1789.test.cpp
verify/verify-yuki/yuki-1875.test.cpp
verify/verify-yuki/yuki-1939-2.test.cpp
verify/verify-yuki/yuki-1939-sparse-pow.test.cpp
verify/verify-yuki/yuki-1939.test.cpp
verify/verify-yuki/yuki-1976.test.cpp
verify/verify-yuki/yuki-2012.test.cpp
verify/verify-yuki/yuki-2231.test.cpp
verify/verify-yuki/yuki-2262.test.cpp
verify/verify-yuki/yuki-2266.test.cpp
verify/verify-yuki/yuki-2281.test.cpp
verify/verify-yuki/yuki-2333.test.cpp
verify/verify-yuki/yuki-2360.test.cpp
verify/verify-yuki/yuki-2580.test.cpp
verify/verify-yuki/yuki-2588.test.cpp
verify/verify-yuki/yuki-2661.test.cpp
verify/verify-yuki/yuki-2677.test.cpp
verify/verify-yuki/yuki-2883.test.cpp
verify/verify-yuki/yuki-3024.test.cpp
verify/verify-yuki/yuki-helloworld.test.cpp
Code
namespace Nyaan {
using ll = long long;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<vector<T>>;
using vi = vector<int>;
using vl = vector<long long>;
using vd = V<double>;
using vs = V<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename U>
struct P : pair<T, U> {
template <typename... Args>
P(Args... args) : pair<T, U>(args...) {}
using pair<T, U>::first;
using pair<T, U>::second;
P &operator+=(const P &r) {
first += r.first;
second += r.second;
return *this;
}
P &operator-=(const P &r) {
first -= r.first;
second -= r.second;
return *this;
}
P &operator*=(const P &r) {
first *= r.first;
second *= r.second;
return *this;
}
template <typename S>
P &operator*=(const S &r) {
first *= r, second *= r;
return *this;
}
P operator+(const P &r) const { return P(*this) += r; }
P operator-(const P &r) const { return P(*this) -= r; }
P operator*(const P &r) const { return P(*this) *= r; }
template <typename S>
P operator*(const S &r) const {
return P(*this) *= r;
}
P operator-() const { return P{-first, -second}; }
};
using pl = P<ll, ll>;
using pi = P<int, int>;
using vp = V<pl>;
constexpr int inf = 1001001001;
constexpr long long infLL = 4004004004004004004LL;
template <typename T>
int sz(const T &t) {
return t.size();
}
template <typename T, typename U>
inline bool amin(T &x, U y) {
return (y < x) ? (x = y, true) : false;
}
template <typename T, typename U>
inline bool amax(T &x, U y) {
return (x < y) ? (x = y, true) : false;
}
template <typename T>
inline T Max(const vector<T> &v) {
return *max_element(begin(v), end(v));
}
template <typename T>
inline T Min(const vector<T> &v) {
return *min_element(begin(v), end(v));
}
template <typename T>
inline long long Sum(const vector<T> &v) {
return accumulate(begin(v), end(v), 0LL);
}
template <typename T>
int lb(const vector<T> &v, const T &a) {
return lower_bound(begin(v), end(v), a) - begin(v);
}
template <typename T>
int ub(const vector<T> &v, const T &a) {
return upper_bound(begin(v), end(v), a) - begin(v);
}
constexpr long long TEN(int n) {
long long ret = 1, x = 10;
for (; n; x *= x, n >>= 1) ret *= (n & 1 ? x : 1);
return ret;
}
template <typename T, typename U>
pair<T, U> mkp(const T &t, const U &u) {
return make_pair(t, u);
}
template <typename T>
vector<T> mkrui(const vector<T> &v, bool rev = false) {
vector<T> ret(v.size() + 1);
if (rev) {
for (int i = int(v.size()) - 1; i >= 0; i--) ret[i] = v[i] + ret[i + 1];
} else {
for (int i = 0; i < int(v.size()); i++) ret[i + 1] = ret[i] + v[i];
}
return ret;
};
template <typename T>
vector<T> mkuni(const vector<T> &v) {
vector<T> ret(v);
sort(ret.begin(), ret.end());
ret.erase(unique(ret.begin(), ret.end()), ret.end());
return ret;
}
template <typename F>
vector<int> mkord(int N, F f) {
vector<int> ord(N);
iota(begin(ord), end(ord), 0);
sort(begin(ord), end(ord), f);
return ord;
}
template <typename T>
vector<int> mkinv(vector<T> &v) {
int max_val = *max_element(begin(v), end(v));
vector<int> inv(max_val + 1, -1);
for (int i = 0; i < (int)v.size(); i++) inv[v[i]] = i;
return inv;
}
vector<int> mkiota(int n) {
vector<int> ret(n);
iota(begin(ret), end(ret), 0);
return ret;
}
template <typename T>
T mkrev(const T &v) {
T w{v};
reverse(begin(w), end(w));
return w;
}
template <typename T>
bool nxp(T &v) {
return next_permutation(begin(v), end(v));
}
// 返り値の型は入力の T に依存
// i 要素目 : [0, a[i])
template <typename T>
vector<vector<T>> product(const vector<T> &a) {
vector<vector<T>> ret;
vector<T> v;
auto dfs = [&](auto rc, int i) -> void {
if (i == (int)a.size()) {
ret.push_back(v);
return;
}
for (int j = 0; j < a[i]; j++) v.push_back(j), rc(rc, i + 1), v.pop_back();
};
dfs(dfs, 0);
return ret;
}
// F : function(void(T&)), mod を取る操作
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I, const function<void(T &)> &f) {
T res = I;
for (; n; f(a = a * a), n >>= 1) {
if (n & 1) f(res = res * a);
}
return res;
}
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I = T{1}) {
return Power(a, n, I, function<void(T &)>{[](T &) -> void {}});
}
template <typename T>
T Rev(const T &v) {
T res = v;
reverse(begin(res), end(res));
return res;
}
template <typename T>
vector<T> Transpose(const vector<T> &v) {
using U = typename T::value_type;
if(v.empty()) return {};
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
res[j][i] = v[i][j];
}
}
return res;
}
template <typename T>
vector<T> Rotate(const vector<T> &v, int clockwise = true) {
using U = typename T::value_type;
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (clockwise) {
res[W - 1 - j][i] = v[i][j];
} else {
res[j][H - 1 - i] = v[i][j];
}
}
}
return res;
}
} // namespace Nyaan
#line 1 "template/util.hpp"
namespace Nyaan {
using ll = long long;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<vector<T>>;
using vi = vector<int>;
using vl = vector<long long>;
using vd = V<double>;
using vs = V<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename U>
struct P : pair<T, U> {
template <typename... Args>
P(Args... args) : pair<T, U>(args...) {}
using pair<T, U>::first;
using pair<T, U>::second;
P &operator+=(const P &r) {
first += r.first;
second += r.second;
return *this;
}
P &operator-=(const P &r) {
first -= r.first;
second -= r.second;
return *this;
}
P &operator*=(const P &r) {
first *= r.first;
second *= r.second;
return *this;
}
template <typename S>
P &operator*=(const S &r) {
first *= r, second *= r;
return *this;
}
P operator+(const P &r) const { return P(*this) += r; }
P operator-(const P &r) const { return P(*this) -= r; }
P operator*(const P &r) const { return P(*this) *= r; }
template <typename S>
P operator*(const S &r) const {
return P(*this) *= r;
}
P operator-() const { return P{-first, -second}; }
};
using pl = P<ll, ll>;
using pi = P<int, int>;
using vp = V<pl>;
constexpr int inf = 1001001001;
constexpr long long infLL = 4004004004004004004LL;
template <typename T>
int sz(const T &t) {
return t.size();
}
template <typename T, typename U>
inline bool amin(T &x, U y) {
return (y < x) ? (x = y, true) : false;
}
template <typename T, typename U>
inline bool amax(T &x, U y) {
return (x < y) ? (x = y, true) : false;
}
template <typename T>
inline T Max(const vector<T> &v) {
return *max_element(begin(v), end(v));
}
template <typename T>
inline T Min(const vector<T> &v) {
return *min_element(begin(v), end(v));
}
template <typename T>
inline long long Sum(const vector<T> &v) {
return accumulate(begin(v), end(v), 0LL);
}
template <typename T>
int lb(const vector<T> &v, const T &a) {
return lower_bound(begin(v), end(v), a) - begin(v);
}
template <typename T>
int ub(const vector<T> &v, const T &a) {
return upper_bound(begin(v), end(v), a) - begin(v);
}
constexpr long long TEN(int n) {
long long ret = 1, x = 10;
for (; n; x *= x, n >>= 1) ret *= (n & 1 ? x : 1);
return ret;
}
template <typename T, typename U>
pair<T, U> mkp(const T &t, const U &u) {
return make_pair(t, u);
}
template <typename T>
vector<T> mkrui(const vector<T> &v, bool rev = false) {
vector<T> ret(v.size() + 1);
if (rev) {
for (int i = int(v.size()) - 1; i >= 0; i--) ret[i] = v[i] + ret[i + 1];
} else {
for (int i = 0; i < int(v.size()); i++) ret[i + 1] = ret[i] + v[i];
}
return ret;
};
template <typename T>
vector<T> mkuni(const vector<T> &v) {
vector<T> ret(v);
sort(ret.begin(), ret.end());
ret.erase(unique(ret.begin(), ret.end()), ret.end());
return ret;
}
template <typename F>
vector<int> mkord(int N, F f) {
vector<int> ord(N);
iota(begin(ord), end(ord), 0);
sort(begin(ord), end(ord), f);
return ord;
}
template <typename T>
vector<int> mkinv(vector<T> &v) {
int max_val = *max_element(begin(v), end(v));
vector<int> inv(max_val + 1, -1);
for (int i = 0; i < (int)v.size(); i++) inv[v[i]] = i;
return inv;
}
vector<int> mkiota(int n) {
vector<int> ret(n);
iota(begin(ret), end(ret), 0);
return ret;
}
template <typename T>
T mkrev(const T &v) {
T w{v};
reverse(begin(w), end(w));
return w;
}
template <typename T>
bool nxp(T &v) {
return next_permutation(begin(v), end(v));
}
// 返り値の型は入力の T に依存
// i 要素目 : [0, a[i])
template <typename T>
vector<vector<T>> product(const vector<T> &a) {
vector<vector<T>> ret;
vector<T> v;
auto dfs = [&](auto rc, int i) -> void {
if (i == (int)a.size()) {
ret.push_back(v);
return;
}
for (int j = 0; j < a[i]; j++) v.push_back(j), rc(rc, i + 1), v.pop_back();
};
dfs(dfs, 0);
return ret;
}
// F : function(void(T&)), mod を取る操作
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I, const function<void(T &)> &f) {
T res = I;
for (; n; f(a = a * a), n >>= 1) {
if (n & 1) f(res = res * a);
}
return res;
}
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I = T{1}) {
return Power(a, n, I, function<void(T &)>{[](T &) -> void {}});
}
template <typename T>
T Rev(const T &v) {
T res = v;
reverse(begin(res), end(res));
return res;
}
template <typename T>
vector<T> Transpose(const vector<T> &v) {
using U = typename T::value_type;
if(v.empty()) return {};
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
res[j][i] = v[i][j];
}
}
return res;
}
template <typename T>
vector<T> Rotate(const vector<T> &v, int clockwise = true) {
using U = typename T::value_type;
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (clockwise) {
res[W - 1 - j][i] = v[i][j];
} else {
res[j][H - 1 - i] = v[i][j];
}
}
}
return res;
}
} // namespace Nyaan