diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 6887f708..4aa8a54e 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -19,4 +19,5 @@ jobs: sudo apt-get install clang-format-22 - name: apply formatter run: | - clang-format-22 -style=google --dry-run --Werror $(find . -name "*.hpp") + git ls-files -z '*.hpp' 'test/verify/*.test.cpp' \ + | xargs -0 clang-format-22 -style=google --dry-run --Werror diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index ffd95600..dec9f81e 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -35,29 +35,14 @@ jobs: node-version: 22 - name: Check verification template includes - env: - VERIFY_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - VERIFY_ALLOWLIST: scripts/verify-template-include-allowlist.txt - run: | - args=() - if [[ -n "$VERIFY_BASE_SHA" && ! "$VERIFY_BASE_SHA" =~ ^0+$ ]]; then - if git cat-file -e "$VERIFY_BASE_SHA:$VERIFY_ALLOWLIST" 2>/dev/null; then - base_allowlist="$RUNNER_TEMP/verify-template-include-allowlist.txt" - git show "$VERIFY_BASE_SHA:$VERIFY_ALLOWLIST" > "$base_allowlist" - args+=(--base-allowlist "$base_allowlist") - fi - fi - npm run verify:template-check -- "${args[@]}" + run: npm run verify:template-check - name: Check self-contained headers - env: - VERIFY_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - SELF_CONTAINED_HEADERS: scripts/self-contained-headers.txt run: | check_header() { local path="$1" if [[ ! -f "$path" ]]; then - echo "$SELF_CONTAINED_HEADERS contains a missing header: $path" + echo "Missing header: $path" return 1 fi @@ -68,20 +53,12 @@ jobs: g++ -std=c++17 -fsyntax-only -x c++ -include "./$path" /dev/null } - LC_ALL=C sort -c -u "$SELF_CONTAINED_HEADERS" - while IFS= read -r path; do - [[ -z "$path" || "$path" == \#* ]] && continue + while IFS= read -r -d '' path; do check_header "$path" - done < "$SELF_CONTAINED_HEADERS" - - if [[ -n "$VERIFY_BASE_SHA" && ! "$VERIFY_BASE_SHA" =~ ^0+$ ]]; then - while IFS= read -r -d '' path; do - if ! grep -Fqx -- "$path" "$SELF_CONTAINED_HEADERS"; then - echo "$path must be added to $SELF_CONTAINED_HEADERS" - exit 1 - fi - done < <(git diff --name-only --diff-filter=A -z "$VERIFY_BASE_SHA...HEAD" -- '*.hpp') - fi + done < <(git ls-files -z '*.hpp' \ + | while IFS= read -r -d '' path; do + [[ "$path" == 'template/template.hpp' ]] || printf '%s\0' "$path" + done) markdown-style: runs-on: ubuntu-latest diff --git a/AGENTS.md b/AGENTS.md index 92c85c61..48382997 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,24 +42,13 @@ implementations. Keep each task focused on one feature or one coherent change. not write `using namespace std;` in a header or rely on an includer declaring it first. Apply the same rules when deliberately migrating an existing header; migrate other existing headers incrementally when the task scope - permits. Register every new or migrated header in - `scripts/self-contained-headers.txt` so CI continues compiling it in - isolation. Update `SELF_CONTAINED_HEADER_MIGRATION.md` when a migration batch - changes the recorded progress or history. + permits. CI automatically compiles every tracked `.hpp` except + `template/template.hpp` in isolation. - Do not include `template/template.hpp` from new `test/verify/*.test.cpp` files. Include the required standard library headers and declare any aliases - or helper functions used by the verification code explicitly. Existing - exceptions are tracked in - `scripts/verify-template-include-allowlist.txt`; remove a file from this list - after its dependencies are self-contained and the verification file is - migrated, and never add new exceptions. -- Preserve the include order in verification code when a library header depends - on declarations provided earlier in the file. Format such files with include - sorting disabled, for example: - - ```console - clang-format-22 -style=google --sort-includes=0 -i test/verify/example.test.cpp - ``` + or helper functions used by the verification code explicitly. CI does not + permit exceptions to this rule. Format verification code with normal include + sorting enabled. ## Tests diff --git a/SELF_CONTAINED_HEADER_MIGRATION.md b/SELF_CONTAINED_HEADER_MIGRATION.md deleted file mode 100644 index ad06f129..00000000 --- a/SELF_CONTAINED_HEADER_MIGRATION.md +++ /dev/null @@ -1,200 +0,0 @@ -# Self-contained header migration - -## 目的 - -ライブラリの各ヘッダーを、それより前に別のヘッダーや -`using namespace std;` がなくても利用できる状態へ段階的に移行する。 - -最終的に次の状態を目指す。 - -- 各 `.hpp` が使用する標準ヘッダーとプロジェクトヘッダーを直接 - include する -- ヘッダー内の標準ライブラリ名を `std::` で修飾する -- ヘッダー内で `using namespace std;` を宣言しない -- 各ヘッダーを空の翻訳単位の先頭で include してコンパイルできる -- `test/verify/*.test.cpp` が `template/template.hpp` に依存しない -- verify に通常の clang-format include sorting を適用できる - -`template/template.hpp` は競技用テンプレートとして標準ライブラリの一括 -import と別名を意図的に提供する集約ヘッダーのため、自己完結ヘッダーの一覧から -除外している。 - -## 現在の進捗 - -2026-08-10 時点の進捗は次のとおり。 - -| 項目 | 状態 | 件数 | -| ----------------------------------------- | -------- | ---- | -| リポジトリ内の `.hpp` | 調査済み | 320 | -| 自己完結化して継続検査しているヘッダー | 移行済み | 319 | -| `template/template.hpp` に依存する verify | 移行済み | 0 | - -移行済みヘッダーの正本は -[`scripts/self-contained-headers.txt`](scripts/self-contained-headers.txt)、 -未移行 verify の正本は -[`scripts/verify-template-include-allowlist.txt`](scripts/verify-template-include-allowlist.txt) -とする。この文書の件数と差がある場合は、これらの一覧を優先する。 - -## 段階 - -### 1. 新規コードの品質を固定する - -状態: 完了 - -- 新規ヘッダーに自己完結性を要求する -- 新規 verify の `template/template.hpp` 依存を禁止する -- CI で許可リストの増加を禁止する - -### 2. 既存ヘッダーを自己完結化する - -状態: 完了 - -依存するプロジェクトヘッダーが少ないものから、小さなまとまりで移行する。 -移行したヘッダーは `scripts/self-contained-headers.txt` に追加し、CI で毎回 -単体コンパイルする。 - -### 3. 対応する verify を移行する - -状態: 完了 - -依存先ヘッダーが自己完結した後、対応する verify から -`template/template.hpp` を削除する。必要な標準ヘッダー、型別名、入出力処理、 -補助関数は verify 側に明示する。verify では簡潔さのため -`using namespace std;` の使用を許可する。移行後は -`scripts/verify-template-include-allowlist.txt` から対象を削除する。 - -### 4. 移行済みコードの逆戻りを防ぐ - -状態: 完了 - -- 自己完結化済みヘッダーは CI で継続的に単体コンパイルしている -- verify の例外追加は禁止している -- verify の例外リストは空の状態を継続検査する - -### 5. 一律の検査へ切り替える - -状態: 未着手 - -全ヘッダーと verify の移行後、全 `.hpp` の単体コンパイルと全 verify の -`template/template.hpp` 禁止を一律に適用する。verify の -`--sort-includes=0` 例外も撤廃する。 - -## ヘッダー移行手順 - -1. 依存の少ないヘッダーまたは密接に関連する小さなヘッダー群を選ぶ -2. 必要な標準ヘッダーとプロジェクトヘッダーを直接 include する -3. 標準ライブラリ名を `std::` で修飾する -4. 必要に応じて `#pragma once` を追加する -5. `scripts/self-contained-headers.txt` にパスを辞書順で追加する -6. 正常系、境界値、重要な前提を検査する単体テストを追加または更新する -7. 関連ドキュメントのシグネチャや制約を更新する -8. clang-format、ヘッダー単体コンパイル、単体テスト、docs check を実行する -9. この文書の進捗件数と移行履歴を更新する - -ヘッダー単体コンパイルには、CI と同じ次の形式を使用できる。 - -```console -g++ -std=c++17 -fsyntax-only -x c++ -include ./path/to/header.hpp /dev/null -``` - -## 移行履歴 - -| 日付 | 対象 | 備考 | -| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -| 2026-08-04 | `structure/others/sparse-table.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-04 | `structure/others/disjoint-sparse-table.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-04 | `structure/others/plus-minus-one-rmq.hpp` | Sparse Table 依存を明示 | -| 2026-08-04 | `structure/others/queue-operate-aggregation.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/deque-operate-aggregation.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/abstract-binary-indexed-tree.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/binary-indexed-tree.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/persistent-array.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/priority-sum-structure.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/others/linear-rmq.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/union-find/union-find.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/union-find/weighted-union-find.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/union-find/union-find-undo.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/union-find/partially-persistent-union-find.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/union-find/persistent-union-find.hpp` | Persistent Array 依存を明示 | -| 2026-08-04 | `structure/union-find/bipartite-graph.hpp` | Union Find 依存を明示 | -| 2026-08-04 | `structure/heap/erasable-heap.hpp` | 標準依存を補完 | -| 2026-08-04 | `structure/heap/leftist-heap.hpp` | 標準依存を明示 | -| 2026-08-04 | `structure/heap/persistent-leftist-heap.hpp` | Leftist Heap 依存を明示 | -| 2026-08-04 | `structure/heap/skew-heap.hpp` | 標準依存を明示 | -| 2026-08-10 | `dp/cumulative-sum-2d.hpp`、`dp/cumulative-sum.hpp`、`dp/edit-distance.hpp`、`dp/knapsack-01-2.hpp`、`dp/knapsack-01.hpp`、`dp/knapsack-limitations.hpp`、`dp/knapsack.hpp`、`dp/largest-rectangle.hpp`、`dp/longest-increasing-subsequence.hpp`、`dp/monotone-minima.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `structure/class/act.hpp`、`structure/class/acted-monoid.hpp`、`structure/class/affine.hpp`、`structure/class/beats-monoid.hpp`、`structure/class/monoid.hpp`、`structure/class/range-add-range-min.hpp`、`structure/class/range-chmin-chmax-add-range-sum.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `structure/others/slope-trick.hpp`、`structure/others/sqrt-decomposition.hpp`、`structure/others/union-rectangle.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `dp/divide-and-conquer-optimization.hpp`、`dp/knapsack-limitations-2.hpp`、`dp/online-offline-dp.hpp` | 移行済みヘッダーへの依存を明示 | -| 2026-08-10 | `graph/graph-template.hpp`、`graph/shortest-path/bellman-ford.hpp`、`graph/shortest-path/bfs.hpp`、`graph/shortest-path/dijkstra.hpp`、`graph/shortest-path/grid-bfs.hpp`、`graph/shortest-path/warshall-floyd.hpp` | グラフ共通型と標準 include を明示 | -| 2026-08-10 | `math/combinatorics/` の6ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `math/matrix/matrix.hpp`、`math/matrix/square-matrix.hpp`、`math/rational/rational.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `math/number-theory/` の11ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `other/` の9ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `string/manacher.hpp`、`string/z-algorithm.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | geometry の基礎・距離・交差判定・多角形関連38ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `geometry/integer/point.hpp`、`geometry/convex-layers.hpp`、`structure/others/decremental-upper-hull.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `math/combinatorics/` の18ヘッダー、`math/fft/` の13ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `math/number-theory/` の4ヘッダー、`structure/class/` の3ヘッダー、`other/` の2ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `graph/others/` の16ヘッダー、`graph/mst/` の5ヘッダー、`graph/tree/` の6ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `other/` の14ヘッダー、`math/matrix/binary-basis.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `graph/connected-components/` の5ヘッダー、`graph/others/block-cut-tree.hpp`、`math/fps/` の20ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `string/` の7ヘッダー、`structure/segment-tree/` の6ヘッダー、`structure/trie/trie.hpp` | 標準 include と `std::` 修飾 | -| 2026-08-10 | `graph/flow/` の2ヘッダー、`graph/shortest-path/` の7ヘッダー、`graph/tree/` の9ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `structure/` の20ヘッダー、`other/` の2ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `geometry/template.hpp`、`graph/flow/` の10ヘッダー、`graph/mst/` の1ヘッダー、`graph/others/` の2ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | `structure/bbst/` の10ヘッダー、`structure/dynamic-tree/` の13ヘッダー、`structure/wavelet/` の2ヘッダー | 標準 include と `std::` 修飾 | -| 2026-08-10 | 移行済みヘッダー34件 | 未修飾標準名と include guard を修正 | -| 2026-08-10 | AOJ DPL の verify 7件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ DPL の組合せ verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ DSL の verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ GRL の最短路 verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ GRL の全域木 verify 5件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ GRL の連結性 verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ GRL の木 verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ GRL のフロー verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ の基礎数論 verify 5件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ ALDS の verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | AOJ CGL の verify 16件 | 出力精度を維持して依存を削除 | -| 2026-08-10 | Library Checker Static RMQ の verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker LCA の verify 4件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker Range Kth Smallest の verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の基礎 verify 11件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker Static Range Query の verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker Point Set Range Composite の verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の文字列・閉路 verify 5件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の数論 verify 7件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の組合せ列 verify 5件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker のグラフ verify 10件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の FPS verify 14件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の verify 3件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker のビット畳み込み verify 4件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker のアフィン作用 verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の矩形クエリ verify 8件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の代数 verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker のグラフ出力 verify 6件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の直線・区間最小値 verify 4件 | テンプレート依存を削除 | -| 2026-08-10 | Library Checker の動的木 verify 6件 | テンプレート依存を削除 | - -| 2026-08-10 | Library Checker の残り verify 6件 | テンプレート依存を削除 | - -| 2026-08-10 | AOJ の verify 7件 | テンプレート依存を削除 | - -| 2026-08-10 | AOJ の verify 7件(第2バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | AOJ の verify 7件(第3バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | AOJ の verify 6件(第4バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | AOJ の verify 6件(最終バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | yukicoder の verify 7件(第1バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | yukicoder の verify 7件(第2バッチ) | テンプレート依存を削除 | - -| 2026-08-10 | yukicoder の verify 7件(最終バッチ) | テンプレート依存を削除 | - -## 次の候補 - -ヘッダーの自己完結化と、全 verify の `template/template.hpp` 依存削除は -完了している。次は verify の `--sort-includes=0` 例外を確認し、 -一律の検査へ切り替える。 diff --git a/scripts/check-verify-template-includes.mjs b/scripts/check-verify-template-includes.mjs index be6d768d..4743dd29 100644 --- a/scripts/check-verify-template-includes.mjs +++ b/scripts/check-verify-template-includes.mjs @@ -1,13 +1,9 @@ -import { existsSync, readFileSync, readdirSync } from "node:fs"; +import { readFileSync, readdirSync } from "node:fs"; import { dirname, relative, resolve } from "node:path"; import { fileURLToPath } from "node:url"; const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), ".."); const verifyDirectory = resolve(repositoryRoot, "test/verify"); -const allowlistPath = resolve( - repositoryRoot, - "scripts/verify-template-include-allowlist.txt", -); const templateInclude = /^\s*#\s*include\s*["<][^">]*template\/template\.hpp[">]/m; @@ -15,23 +11,6 @@ function repositoryPath(path) { return relative(repositoryRoot, path).replaceAll("\\", "/"); } -function readAllowlist() { - const entries = readFileSync(allowlistPath, "utf8") - .split(/\r?\n/) - .filter((line) => line !== "" && !line.startsWith("#")); - const sortedEntries = [...new Set(entries)].sort(); - - if ( - entries.length !== sortedEntries.length || - entries.some((entry, index) => entry !== sortedEntries[index]) - ) { - throw new Error( - `${repositoryPath(allowlistPath)} must be sorted and contain no duplicates`, - ); - } - return new Set(entries); -} - function findTemplateIncludes() { return new Set( readdirSync(verifyDirectory) @@ -42,61 +21,18 @@ function findTemplateIncludes() { ); } -let baseAllowlistPath; -for (let index = 2; index < process.argv.length; index += 1) { - const option = process.argv[index]; - if (option !== "--base-allowlist") { - throw new Error(`unknown option: ${option}`); - } - if (baseAllowlistPath !== undefined) { - throw new Error("--base-allowlist may be specified at most once"); - } - if (index + 1 === process.argv.length) { - throw new Error("--base-allowlist requires a value"); - } - baseAllowlistPath = process.argv[index + 1]; - index += 1; +if (process.argv.length !== 2) { + throw new Error("this check does not accept command-line options"); } -const allowlist = readAllowlist(); const templateIncludes = findTemplateIncludes(); -const errors = []; - -for (const path of templateIncludes) { - if (!allowlist.has(path)) { - errors.push(`${path}: template/template.hpp is not allowed`); - } -} -for (const path of allowlist) { - if (!existsSync(resolve(repositoryRoot, path))) { - errors.push(`${repositoryPath(allowlistPath)}: missing file: ${path}`); - } else if (!templateIncludes.has(path)) { - errors.push( - `${repositoryPath(allowlistPath)}: remove migrated entry: ${path}`, - ); - } -} - -if (baseAllowlistPath !== undefined) { - const baseAllowlist = new Set( - readFileSync(baseAllowlistPath, "utf8") - .split(/\r?\n/) - .filter((line) => line !== "" && !line.startsWith("#")), - ); - for (const path of allowlist) { - if (!baseAllowlist.has(path)) { - errors.push( - `${repositoryPath(allowlistPath)}: adding an exemption is not allowed: ${path}`, - ); - } - } -} +const errors = [...templateIncludes].map( + (path) => `${path}: template/template.hpp is not allowed`, +); if (errors.length > 0) { console.error(errors.join("\n")); process.exitCode = 1; } else { - console.log( - `Checked verification template includes (${allowlist.size} exemptions remain).`, - ); + console.log("Checked verification template includes (no exemptions allowed)."); } diff --git a/scripts/self-contained-headers.txt b/scripts/self-contained-headers.txt deleted file mode 100644 index dd65039d..00000000 --- a/scripts/self-contained-headers.txt +++ /dev/null @@ -1,320 +0,0 @@ -# Headers migrated to direct includes and explicit std:: qualification. -dp/cumulative-sum-2d.hpp -dp/cumulative-sum.hpp -dp/divide-and-conquer-optimization.hpp -dp/edit-distance.hpp -dp/knapsack-01-2.hpp -dp/knapsack-01.hpp -dp/knapsack-limitations-2.hpp -dp/knapsack-limitations.hpp -dp/knapsack.hpp -dp/largest-rectangle.hpp -dp/longest-increasing-subsequence.hpp -dp/monotone-minima.hpp -dp/online-offline-dp.hpp -geometry/angle.hpp -geometry/area.hpp -geometry/base.hpp -geometry/ccw.hpp -geometry/circle.hpp -geometry/common_area_cp.hpp -geometry/contains.hpp -geometry/convex-layers.hpp -geometry/convex_hull.hpp -geometry/convex_polygon_contains.hpp -geometry/convex_polygon_cut.hpp -geometry/convex_polygon_diameter.hpp -geometry/cross_point_cc.hpp -geometry/cross_point_cl.hpp -geometry/cross_point_cs.hpp -geometry/cross_point_ll.hpp -geometry/distance_ll.hpp -geometry/distance_lp.hpp -geometry/distance_pp.hpp -geometry/distance_sp.hpp -geometry/distance_ss.hpp -geometry/integer/point.hpp -geometry/is_convex_polygon.hpp -geometry/is_intersect_cl.hpp -geometry/is_intersect_cp.hpp -geometry/is_intersect_cs.hpp -geometry/is_intersect_ll.hpp -geometry/is_intersect_lp.hpp -geometry/is_intersect_ls.hpp -geometry/is_intersect_sp.hpp -geometry/is_intersect_ss.hpp -geometry/is_orthogonal.hpp -geometry/is_parallel.hpp -geometry/line.hpp -geometry/point.hpp -geometry/polygon.hpp -geometry/projection.hpp -geometry/reflection.hpp -geometry/segment.hpp -geometry/template.hpp -graph/connected-components/bi-connected-components.hpp -graph/connected-components/incremental-bridge-connectivity.hpp -graph/connected-components/strongly-connected-components.hpp -graph/connected-components/three-edge-connected-components.hpp -graph/connected-components/two-edge-connected-components.hpp -graph/flow/bipartite-flow.hpp -graph/flow/bipartite-matching.hpp -graph/flow/burn-bury.hpp -graph/flow/dinic-capacity-scaling.hpp -graph/flow/dinic.hpp -graph/flow/ford-fulkerson.hpp -graph/flow/gabow-edmonds.hpp -graph/flow/global-minimum-cut-of-dynamic-star-augmented-graph.hpp -graph/flow/hungarian.hpp -graph/flow/maxflow-lower-bound.hpp -graph/flow/primal-dual.hpp -graph/flow/push-relabel.hpp -graph/graph-template.hpp -graph/mst/boruvka.hpp -graph/mst/directed-mst.hpp -graph/mst/kruskal.hpp -graph/mst/manhattan-mst.hpp -graph/mst/prim-fibonacchi-heap.hpp -graph/mst/prim.hpp -graph/others/bipartite-graph-edge-coloring.hpp -graph/others/block-cut-tree.hpp -graph/others/cartesian-tree.hpp -graph/others/chromatic-number.hpp -graph/others/cycle-detection.hpp -graph/others/dominator-tree.hpp -graph/others/enumerate-cliques.hpp -graph/others/enumerate-triangles.hpp -graph/others/eulerian-trail.hpp -graph/others/extreme-vertex-set.hpp -graph/others/low-link.hpp -graph/others/maximum-clique.hpp -graph/others/maximum-independent-set.hpp -graph/others/minimum-steiner-tree.hpp -graph/others/namori-graph.hpp -graph/others/offline-dag-reachability.hpp -graph/others/topological-sort.hpp -graph/others/tree-decomposition-width-2.hpp -graph/others/two-satisfiability.hpp -graph/shortest-path/bellman-ford.hpp -graph/shortest-path/bfs.hpp -graph/shortest-path/complement-shotest-path.hpp -graph/shortest-path/dijkstra-fibonacchi-heap.hpp -graph/shortest-path/dijkstra-radix-heap.hpp -graph/shortest-path/dijkstra.hpp -graph/shortest-path/grid-bfs.hpp -graph/shortest-path/k-shortest-path.hpp -graph/shortest-path/k-shortest-walk.hpp -graph/shortest-path/shortest-nonzero-path.hpp -graph/shortest-path/shortest-path-faster-algorithm.hpp -graph/shortest-path/warshall-floyd.hpp -graph/tree/centroid-decomposition.hpp -graph/tree/centroid.hpp -graph/tree/convert-rooted-tree.hpp -graph/tree/disjoint-set-union-on-tree.hpp -graph/tree/doubling-lowest-common-ancestor.hpp -graph/tree/heavy-light-decomposition.hpp -graph/tree/offline-lca.hpp -graph/tree/pmormq-lowest-common-ancestor.hpp -graph/tree/rerooting.hpp -graph/tree/rmq-lowest-common-ancestor.hpp -graph/tree/static-top-tree-dp.hpp -graph/tree/static-top-tree.hpp -graph/tree/tree-diameter.hpp -graph/tree/tree-isomorphism.hpp -math/combinatorics/arbitrary-mod-int.hpp -math/combinatorics/bell-number.hpp -math/combinatorics/binomial-prefix-sum-query.hpp -math/combinatorics/binomial-table.hpp -math/combinatorics/binomial.hpp -math/combinatorics/count-bounded-increasing-sequences.hpp -math/combinatorics/enumeration.hpp -math/combinatorics/factorial.hpp -math/combinatorics/lagrange-polynomial-2.hpp -math/combinatorics/lagrange-polynomial-3.hpp -math/combinatorics/lagrange-polynomial.hpp -math/combinatorics/mod-log.hpp -math/combinatorics/mod-pow.hpp -math/combinatorics/mod-sqrt.hpp -math/combinatorics/mod-tetration.hpp -math/combinatorics/modint-2-61m1.hpp -math/combinatorics/montgomery-mod-int.hpp -math/combinatorics/montmort.hpp -math/combinatorics/partition-table.hpp -math/combinatorics/sample-point-shift.hpp -math/combinatorics/stirling-number-second.hpp -math/combinatorics/sum-of-arithmetic-sequence.hpp -math/combinatorics/sum-of-geometric-sequence.hpp -math/combinatorics/vectorize-mod-int.hpp -math/fft/arbitrary-mod-convolution-long.hpp -math/fft/arbitrary-mod-convolution.hpp -math/fft/bitwise-and-convolution.hpp -math/fft/bitwise-or-convolution.hpp -math/fft/bitwise-xor-convolution.hpp -math/fft/fast-fourier-transform.hpp -math/fft/fast-walsh-hadamard-transform.hpp -math/fft/number-theoretic-transform-friendly-mod-int.hpp -math/fft/number-theoretic-transform.hpp -math/fft/subset-convolution.hpp -math/fft/subset-zeta-moebius-transform.hpp -math/fft/superset-zeta-moebius-transform-simd.hpp -math/fft/superset-zeta-moebius-transform.hpp -math/fps/bell.hpp -math/fps/berlekamp-massey.hpp -math/fps/bernoulli.hpp -math/fps/binomial-prefix-sum.hpp -math/fps/coeff-of-rational-function.hpp -math/fps/composition-of-formal-power-series.hpp -math/fps/compositional-inverse-of-formal-power-series.hpp -math/fps/count-subset-sum.hpp -math/fps/enumerate-coefficients-of-powers.hpp -math/fps/eulerian.hpp -math/fps/formal-power-series-friendly-ntt.hpp -math/fps/formal-power-series.hpp -math/fps/kth-term-of-linearly-recurrent-sequence.hpp -math/fps/multipoint-evaluation.hpp -math/fps/partition.hpp -math/fps/polynomial-interpolation.hpp -math/fps/sparse-matrix.hpp -math/fps/stirling-first.hpp -math/fps/stirling-second.hpp -math/fps/subproduct-tree.hpp -math/matrix/binary-basis.hpp -math/matrix/matrix.hpp -math/matrix/square-matrix.hpp -math/number-theory/convert-base.hpp -math/number-theory/divisor.hpp -math/number-theory/enumerate-primes.hpp -math/number-theory/enumerate-quotients.hpp -math/number-theory/euler-phi-table.hpp -math/number-theory/euler-phi.hpp -math/number-theory/extgcd.hpp -math/number-theory/fast-prime-factorization.hpp -math/number-theory/is-prime.hpp -math/number-theory/kth-root-integer.hpp -math/number-theory/moebius-mu-table.hpp -math/number-theory/prime-count.hpp -math/number-theory/prime-factor.hpp -math/number-theory/prime-table.hpp -math/number-theory/sum-of-floor-of-linear.hpp -math/rational/rational.hpp -other/area-of-union-of-rectangles.hpp -other/ceil-div.hpp -other/chrono-timer.hpp -other/compress.hpp -other/connected-grid-states.hpp -other/dice.hpp -other/dynamic-point-add-rectangle-sum.hpp -other/dynamic-rectangle-add-point-get.hpp -other/floor-div.hpp -other/mo-rollback.hpp -other/mo-tree.hpp -other/mo.hpp -other/offline-dynamic-connectivity.hpp -other/offline-rmq.hpp -other/poyopoyo-pudding.hpp -other/printer.hpp -other/random-number-generator.hpp -other/scanner.hpp -other/static-point-add-rectangle-sum.hpp -other/static-range-count-distinct.hpp -other/static-range-frequency.hpp -other/static-rectangle-add-point-get.hpp -other/static-rectangle-add-rectangle-sum.hpp -other/timer.hpp -other/vector-pool.hpp -other/xor-shift.hpp -string/aho-corasick.hpp -string/lcp-array.hpp -string/longest-common-substring.hpp -string/manacher.hpp -string/palindromic-tree.hpp -string/rolling-hash.hpp -string/suffix-array.hpp -string/wildcard-pattern-matching.hpp -string/z-algorithm.hpp -structure/bbst/lazy-red-black-tree.hpp -structure/bbst/lazy-reversible-splay-tree.hpp -structure/bbst/lazy-weight-balanced-tree.hpp -structure/bbst/persistent-lazy-red-black-tree.hpp -structure/bbst/persistent-lazy-weight-balanced-tree.hpp -structure/bbst/persistent-red-black-tree.hpp -structure/bbst/persistent-weight-balanced-tree.hpp -structure/bbst/randomized-binary-search-tree-lazy.hpp -structure/bbst/randomized-binary-search-tree-set.hpp -structure/bbst/randomized-binary-search-tree.hpp -structure/bbst/red-black-tree.hpp -structure/bbst/reversible-splay-tree.hpp -structure/bbst/weight-balanced-tree.hpp -structure/class/act.hpp -structure/class/acted-monoid.hpp -structure/class/affine.hpp -structure/class/beats-monoid.hpp -structure/class/monoid.hpp -structure/class/point-add-rectangle-sum.hpp -structure/class/point-set-range-composite.hpp -structure/class/range-add-range-min.hpp -structure/class/range-affine-range-sum.hpp -structure/class/range-chmin-chmax-add-range-sum.hpp -structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp -structure/convex-hull-trick/dynamic-li-chao-tree.hpp -structure/convex-hull-trick/li-chao-tree.hpp -structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp -structure/dynamic-tree/diameter.hpp -structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp -structure/dynamic-tree/dynamic-tree-builder-for-vertex.hpp -structure/dynamic-tree/lazy-link-cut-tree.hpp -structure/dynamic-tree/lazy-top-tree.hpp -structure/dynamic-tree/link-cut-tree-for-subtree.hpp -structure/dynamic-tree/link-cut-tree.hpp -structure/dynamic-tree/subtree-add-subtree-sum.hpp -structure/dynamic-tree/top-tree.hpp -structure/dynamic-tree/vertex-set-path-composite.hpp -structure/dynamic-tree/vertex-set-path-sum.hpp -structure/dynamic-tree/vertex-set-subtree-sum.hpp -structure/dynamic-tree/vertex-set-tree-path-composite-sum.hpp -structure/heap/erasable-heap.hpp -structure/heap/fibonacchi-heap.hpp -structure/heap/leftist-heap.hpp -structure/heap/partially-retroactive-priority-queue.hpp -structure/heap/persistent-leftist-heap.hpp -structure/heap/radix-heap.hpp -structure/heap/skew-heap.hpp -structure/others/abstract-2d-binary-indexed-tree-compressed.hpp -structure/others/abstract-binary-indexed-tree.hpp -structure/others/binary-indexed-tree.hpp -structure/others/decremental-upper-hull.hpp -structure/others/deque-operate-aggregation.hpp -structure/others/disjoint-sparse-table.hpp -structure/others/generalized-slope-trick.hpp -structure/others/linear-rmq.hpp -structure/others/permutation-tree.hpp -structure/others/persistent-array.hpp -structure/others/plus-minus-one-rmq.hpp -structure/others/priority-sum-structure.hpp -structure/others/queue-operate-aggregation.hpp -structure/others/slope-trick.hpp -structure/others/sparse-table.hpp -structure/others/sqrt-decomposition.hpp -structure/others/union-rectangle.hpp -structure/segment-tree/dual-segment-tree.hpp -structure/segment-tree/lazy-segment-tree.hpp -structure/segment-tree/persistent-segment-tree.hpp -structure/segment-tree/range-linear-add-range-min-segment-tree.hpp -structure/segment-tree/range-tree.hpp -structure/segment-tree/segment-tree-beats.hpp -structure/segment-tree/segment-tree-fractional-cascading.hpp -structure/segment-tree/segment-tree.hpp -structure/trie/binary-trie.hpp -structure/trie/persistent-binary-trie.hpp -structure/trie/trie.hpp -structure/union-find/bipartite-graph.hpp -structure/union-find/partially-persistent-union-find.hpp -structure/union-find/persistent-union-find.hpp -structure/union-find/union-find-undo.hpp -structure/union-find/union-find.hpp -structure/union-find/weighted-union-find.hpp -structure/wavelet/succinct-indexable-dictionary.hpp -structure/wavelet/wavelet-matrix-point-add-rectangle-sum.hpp -structure/wavelet/wavelet-matrix-rectangle-sum.hpp -structure/wavelet/wavelet-matrix.hpp -structure/wavelet/wavelet-tree.hpp diff --git a/scripts/verify-template-include-allowlist.txt b/scripts/verify-template-include-allowlist.txt deleted file mode 100644 index 3184ed5b..00000000 --- a/scripts/verify-template-include-allowlist.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Existing verification tests that still include template/template.hpp. -# Remove entries as tests are migrated; do not add new entries. diff --git a/test/unittest/self-contained-header-migration.test.cpp b/test/unittest/self-contained-header-migration.test.cpp deleted file mode 100644 index 0dc61a16..00000000 --- a/test/unittest/self-contained-header-migration.test.cpp +++ /dev/null @@ -1,473 +0,0 @@ -// competitive-verifier: STANDALONE - -#include -#include -#include -#include -#include - -#include "../../graph/flow/dinic.hpp" -#include "../../graph/flow/bipartite-flow.hpp" -#include "../../graph/flow/bipartite-matching.hpp" -#include "../../graph/flow/burn-bury.hpp" -#include "../../graph/flow/dinic-capacity-scaling.hpp" -#include "../../graph/flow/gabow-edmonds.hpp" -#include "../../graph/flow/global-minimum-cut-of-dynamic-star-augmented-graph.hpp" -#include "../../graph/flow/hungarian.hpp" -#include "../../graph/flow/maxflow-lower-bound.hpp" -#include "../../graph/flow/primal-dual.hpp" -#include "../../graph/flow/push-relabel.hpp" -#include "../../graph/mst/prim-fibonacchi-heap.hpp" -#include "../../graph/mst/boruvka.hpp" -#include "../../graph/others/bipartite-graph-edge-coloring.hpp" -#include "../../graph/others/two-satisfiability.hpp" -#include "../../graph/flow/ford-fulkerson.hpp" -#include "../../graph/shortest-path/complement-shotest-path.hpp" -#include "../../graph/shortest-path/dijkstra-fibonacchi-heap.hpp" -#include "../../graph/shortest-path/dijkstra-radix-heap.hpp" -#include "../../graph/shortest-path/k-shortest-path.hpp" -#include "../../graph/shortest-path/k-shortest-walk.hpp" -#include "../../graph/shortest-path/shortest-nonzero-path.hpp" -#include "../../graph/shortest-path/shortest-path-faster-algorithm.hpp" -#include "../../graph/tree/centroid-decomposition.hpp" -#include "../../graph/tree/disjoint-set-union-on-tree.hpp" -#include "../../graph/tree/doubling-lowest-common-ancestor.hpp" -#include "../../graph/tree/offline-lca.hpp" -#include "../../graph/tree/pmormq-lowest-common-ancestor.hpp" -#include "../../graph/tree/rmq-lowest-common-ancestor.hpp" -#include "../../graph/tree/static-top-tree-dp.hpp" -#include "../../graph/tree/static-top-tree.hpp" -#include "../../graph/tree/tree-isomorphism.hpp" -#include "../../other/area-of-union-of-rectangles.hpp" -#include "../../other/mo-tree.hpp" -#include "../../structure/bbst/lazy-red-black-tree.hpp" -#include "../../structure/bbst/lazy-reversible-splay-tree.hpp" -#include "../../structure/bbst/lazy-weight-balanced-tree.hpp" -#include "../../structure/bbst/persistent-lazy-red-black-tree.hpp" -#include "../../structure/bbst/persistent-lazy-weight-balanced-tree.hpp" -#include "../../structure/bbst/persistent-red-black-tree.hpp" -#include "../../structure/bbst/persistent-weight-balanced-tree.hpp" -#include "../../structure/bbst/randomized-binary-search-tree-set.hpp" -#include "../../structure/bbst/randomized-binary-search-tree.hpp" -#include "../../structure/bbst/red-black-tree.hpp" -#include "../../structure/bbst/reversible-splay-tree.hpp" -#include "../../structure/bbst/weight-balanced-tree.hpp" -#include "../../structure/convex-hull-trick/convex-hull-trick-add-monotone.hpp" -#include "../../structure/convex-hull-trick/dynamic-li-chao-tree.hpp" -#include "../../structure/convex-hull-trick/li-chao-tree.hpp" -#include "../../structure/convex-hull-trick/persistent-dynamic-li-chao-tree.hpp" -#include "../../structure/heap/fibonacchi-heap.hpp" -#include "../../structure/heap/partially-retroactive-priority-queue.hpp" -#include "../../structure/heap/radix-heap.hpp" -#include "../../structure/others/abstract-2d-binary-indexed-tree-compressed.hpp" -#include "../../structure/others/generalized-slope-trick.hpp" -#include "../../structure/others/permutation-tree.hpp" -#include "../../structure/segment-tree/segment-tree-fractional-cascading.hpp" -#include "../../structure/segment-tree/segment-tree.hpp" -#include "../../structure/trie/binary-trie.hpp" -#include "../../structure/trie/persistent-binary-trie.hpp" -#include "../../structure/dynamic-tree/diameter.hpp" -#include "../../structure/dynamic-tree/dynamic-tree-builder-for-edge.hpp" -#include "../../structure/dynamic-tree/dynamic-tree-builder-for-vertex.hpp" -#include "../../structure/dynamic-tree/lazy-link-cut-tree.hpp" -#include "../../structure/dynamic-tree/lazy-top-tree.hpp" -#include "../../structure/dynamic-tree/link-cut-tree-for-subtree.hpp" -#include "../../structure/dynamic-tree/link-cut-tree.hpp" -#include "../../structure/dynamic-tree/subtree-add-subtree-sum.hpp" -#include "../../structure/dynamic-tree/top-tree.hpp" -#include "../../structure/dynamic-tree/vertex-set-path-composite.hpp" -#include "../../structure/dynamic-tree/vertex-set-path-sum.hpp" -#include "../../structure/dynamic-tree/vertex-set-subtree-sum.hpp" -#include "../../structure/dynamic-tree/vertex-set-tree-path-composite-sum.hpp" -#include "../../structure/wavelet/succinct-indexable-dictionary.hpp" -#include "../../structure/wavelet/wavelet-matrix-point-add-rectangle-sum.hpp" -#include "../../structure/wavelet/wavelet-matrix-rectangle-sum.hpp" -#include "../../structure/wavelet/wavelet-matrix.hpp" -#include "../../structure/wavelet/wavelet-tree.hpp" -#include "../../graph/connected-components/bi-connected-components.hpp" -#include "../../graph/connected-components/incremental-bridge-connectivity.hpp" -#include "../../graph/connected-components/strongly-connected-components.hpp" -#include "../../graph/connected-components/three-edge-connected-components.hpp" -#include "../../graph/connected-components/two-edge-connected-components.hpp" -#include "../../graph/others/block-cut-tree.hpp" -#include "../../math/fps/bell.hpp" -#include "../../math/fps/berlekamp-massey.hpp" -#include "../../math/fps/bernoulli.hpp" -#include "../../math/fps/binomial-prefix-sum.hpp" -#include "../../math/fps/coeff-of-rational-function.hpp" -#include "../../math/fps/composition-of-formal-power-series.hpp" -#include "../../math/fps/compositional-inverse-of-formal-power-series.hpp" -#include "../../math/fps/count-subset-sum.hpp" -#include "../../math/fps/enumerate-coefficients-of-powers.hpp" -#include "../../math/fps/eulerian.hpp" -#include "../../math/fps/formal-power-series-friendly-ntt.hpp" -#include "../../math/fps/kth-term-of-linearly-recurrent-sequence.hpp" -#include "../../math/fps/multipoint-evaluation.hpp" -#include "../../math/fps/partition.hpp" -#include "../../math/fps/polynomial-interpolation.hpp" -#include "../../math/fps/stirling-first.hpp" -#include "../../math/fps/stirling-second.hpp" -#include "../../math/fps/subproduct-tree.hpp" -#include "../../string/aho-corasick.hpp" -#include "../../string/lcp-array.hpp" -#include "../../string/longest-common-substring.hpp" -#include "../../string/palindromic-tree.hpp" -#include "../../string/rolling-hash.hpp" -#include "../../string/suffix-array.hpp" -#include "../../string/wildcard-pattern-matching.hpp" -#include "../../structure/segment-tree/dual-segment-tree.hpp" -#include "../../structure/segment-tree/lazy-segment-tree.hpp" -#include "../../structure/segment-tree/persistent-segment-tree.hpp" -#include "../../structure/segment-tree/range-linear-add-range-min-segment-tree.hpp" -#include "../../structure/segment-tree/range-tree.hpp" -#include "../../structure/segment-tree/segment-tree-beats.hpp" -#include "../../structure/trie/trie.hpp" -#include "../../graph/mst/boruvka.hpp" -#include "../../graph/mst/manhattan-mst.hpp" -#include "../../graph/others/cartesian-tree.hpp" -#include "../../graph/others/chromatic-number.hpp" -#include "../../graph/others/cycle-detection.hpp" -#include "../../graph/others/dominator-tree.hpp" -#include "../../graph/others/enumerate-cliques.hpp" -#include "../../graph/others/enumerate-triangles.hpp" -#include "../../graph/others/eulerian-trail.hpp" -#include "../../graph/others/extreme-vertex-set.hpp" -#include "../../graph/others/low-link.hpp" -#include "../../graph/others/maximum-clique.hpp" -#include "../../graph/others/maximum-independent-set.hpp" -#include "../../graph/others/minimum-steiner-tree.hpp" -#include "../../graph/others/namori-graph.hpp" -#include "../../graph/others/offline-dag-reachability.hpp" -#include "../../graph/others/topological-sort.hpp" -#include "../../graph/others/tree-decomposition-width-2.hpp" -#include "../../graph/tree/centroid.hpp" -#include "../../graph/tree/convert-rooted-tree.hpp" -#include "../../graph/tree/heavy-light-decomposition.hpp" -#include "../../graph/tree/rerooting.hpp" -#include "../../graph/tree/tree-diameter.hpp" -#include "../../math/matrix/binary-basis.hpp" -#include "../../other/connected-grid-states.hpp" -#include "../../other/dynamic-point-add-rectangle-sum.hpp" -#include "../../other/dynamic-rectangle-add-point-get.hpp" -#include "../../other/mo-rollback.hpp" -#include "../../other/mo.hpp" -#include "../../other/offline-dynamic-connectivity.hpp" -#include "../../other/poyopoyo-pudding.hpp" -#include "../../other/scanner.hpp" -#include "../../other/static-point-add-rectangle-sum.hpp" -#include "../../other/static-range-count-distinct.hpp" -#include "../../other/static-rectangle-add-point-get.hpp" -#include "../../other/static-rectangle-add-rectangle-sum.hpp" -#include "../../other/timer.hpp" -#include "../../dp/cumulative-sum-2d.hpp" -#include "../../dp/cumulative-sum.hpp" -#include "../../dp/divide-and-conquer-optimization.hpp" -#include "../../dp/edit-distance.hpp" -#include "../../dp/knapsack-01-2.hpp" -#include "../../dp/knapsack-01.hpp" -#include "../../dp/knapsack-limitations-2.hpp" -#include "../../dp/knapsack-limitations.hpp" -#include "../../dp/knapsack.hpp" -#include "../../dp/largest-rectangle.hpp" -#include "../../dp/longest-increasing-subsequence.hpp" -#include "../../dp/monotone-minima.hpp" -#include "../../dp/online-offline-dp.hpp" -#include "../../geometry/angle.hpp" -#include "../../geometry/area.hpp" -#include "../../geometry/base.hpp" -#include "../../geometry/ccw.hpp" -#include "../../geometry/circle.hpp" -#include "../../geometry/common_area_cp.hpp" -#include "../../geometry/contains.hpp" -#include "../../geometry/convex-layers.hpp" -#include "../../geometry/convex_hull.hpp" -#include "../../geometry/convex_polygon_contains.hpp" -#include "../../geometry/convex_polygon_cut.hpp" -#include "../../geometry/convex_polygon_diameter.hpp" -#include "../../geometry/cross_point_cc.hpp" -#include "../../geometry/cross_point_cl.hpp" -#include "../../geometry/cross_point_cs.hpp" -#include "../../geometry/cross_point_ll.hpp" -#include "../../geometry/distance_ll.hpp" -#include "../../geometry/distance_lp.hpp" -#include "../../geometry/distance_pp.hpp" -#include "../../geometry/distance_sp.hpp" -#include "../../geometry/distance_ss.hpp" -#include "../../geometry/integer/point.hpp" -#include "../../geometry/is_convex_polygon.hpp" -#include "../../geometry/is_intersect_cl.hpp" -#include "../../geometry/is_intersect_cp.hpp" -#include "../../geometry/is_intersect_cs.hpp" -#include "../../geometry/is_intersect_ll.hpp" -#include "../../geometry/is_intersect_lp.hpp" -#include "../../geometry/is_intersect_ls.hpp" -#include "../../geometry/is_intersect_sp.hpp" -#include "../../geometry/is_intersect_ss.hpp" -#include "../../geometry/is_orthogonal.hpp" -#include "../../geometry/is_parallel.hpp" -#include "../../geometry/line.hpp" -#include "../../geometry/point.hpp" -#include "../../geometry/polygon.hpp" -#include "../../geometry/projection.hpp" -#include "../../geometry/reflection.hpp" -#include "../../geometry/segment.hpp" -#include "../../graph/graph-template.hpp" -#include "../../graph/shortest-path/bellman-ford.hpp" -#include "../../graph/shortest-path/bfs.hpp" -#include "../../graph/shortest-path/dijkstra.hpp" -#include "../../graph/shortest-path/grid-bfs.hpp" -#include "../../graph/shortest-path/warshall-floyd.hpp" -#include "../../math/combinatorics/binomial-table.hpp" -#include "../../math/combinatorics/arbitrary-mod-int.hpp" -#include "../../math/combinatorics/bell-number.hpp" -#include "../../math/combinatorics/binomial-prefix-sum-query.hpp" -#include "../../math/combinatorics/binomial.hpp" -#include "../../math/combinatorics/count-bounded-increasing-sequences.hpp" -#include "../../math/combinatorics/enumeration.hpp" -#include "../../math/combinatorics/factorial.hpp" -#include "../../math/combinatorics/lagrange-polynomial-2.hpp" -#include "../../math/combinatorics/lagrange-polynomial-3.hpp" -#include "../../math/combinatorics/lagrange-polynomial.hpp" -#include "../../math/combinatorics/mod-log.hpp" -#include "../../math/combinatorics/mod-pow.hpp" -#include "../../math/combinatorics/mod-sqrt.hpp" -#include "../../math/combinatorics/mod-tetration.hpp" -#include "../../math/combinatorics/modint-2-61m1.hpp" -#include "../../math/combinatorics/montgomery-mod-int.hpp" -#include "../../math/combinatorics/montmort.hpp" -#include "../../math/combinatorics/partition-table.hpp" -#include "../../math/combinatorics/sample-point-shift.hpp" -#include "../../math/combinatorics/sum-of-arithmetic-sequence.hpp" -#include "../../math/combinatorics/sum-of-geometric-sequence.hpp" -#include "../../math/combinatorics/stirling-number-second.hpp" -#include "../../math/combinatorics/vectorize-mod-int.hpp" -#include "../../math/fft/arbitrary-mod-convolution-long.hpp" -#include "../../math/fft/arbitrary-mod-convolution.hpp" -#include "../../math/fft/bitwise-and-convolution.hpp" -#include "../../math/fft/bitwise-or-convolution.hpp" -#include "../../math/fft/bitwise-xor-convolution.hpp" -#include "../../math/fft/fast-fourier-transform.hpp" -#include "../../math/fft/fast-walsh-hadamard-transform.hpp" -#include "../../math/fft/number-theoretic-transform-friendly-mod-int.hpp" -#include "../../math/fft/number-theoretic-transform.hpp" -#include "../../math/fft/subset-convolution.hpp" -#include "../../math/fft/subset-zeta-moebius-transform.hpp" -#include "../../math/fft/superset-zeta-moebius-transform-simd.hpp" -#include "../../math/fft/superset-zeta-moebius-transform.hpp" -#include "../../math/matrix/matrix.hpp" -#include "../../math/matrix/square-matrix.hpp" -#include "../../math/number-theory/convert-base.hpp" -#include "../../math/number-theory/divisor.hpp" -#include "../../math/number-theory/enumerate-quotients.hpp" -#include "../../math/number-theory/euler-phi-table.hpp" -#include "../../math/number-theory/euler-phi.hpp" -#include "../../math/number-theory/enumerate-primes.hpp" -#include "../../math/number-theory/extgcd.hpp" -#include "../../math/number-theory/fast-prime-factorization.hpp" -#include "../../math/number-theory/is-prime.hpp" -#include "../../math/number-theory/kth-root-integer.hpp" -#include "../../math/number-theory/moebius-mu-table.hpp" -#include "../../math/number-theory/prime-factor.hpp" -#include "../../math/number-theory/prime-count.hpp" -#include "../../math/number-theory/prime-table.hpp" -#include "../../math/number-theory/sum-of-floor-of-linear.hpp" -#include "../../math/number-theory/sum-of-floor-of-linear.hpp" -#include "../../math/rational/rational.hpp" -#include "../../other/ceil-div.hpp" -#include "../../other/chrono-timer.hpp" -#include "../../other/compress.hpp" -#include "../../other/dice.hpp" -#include "../../other/floor-div.hpp" -#include "../../other/printer.hpp" -#include "../../other/random-number-generator.hpp" -#include "../../other/vector-pool.hpp" -#include "../../other/xor-shift.hpp" -#include "../../other/offline-rmq.hpp" -#include "../../other/static-range-frequency.hpp" -#include "../../string/manacher.hpp" -#include "../../string/z-algorithm.hpp" -#include "../../structure/class/act.hpp" -#include "../../structure/class/acted-monoid.hpp" -#include "../../structure/class/affine.hpp" -#include "../../structure/class/beats-monoid.hpp" -#include "../../structure/class/monoid.hpp" -#include "../../structure/class/point-add-rectangle-sum.hpp" -#include "../../structure/class/point-set-range-composite.hpp" -#include "../../structure/class/range-add-range-min.hpp" -#include "../../structure/class/range-chmin-chmax-add-range-sum.hpp" -#include "../../structure/class/range-affine-range-sum.hpp" -#include "../../structure/others/decremental-upper-hull.hpp" -#include "../../structure/others/slope-trick.hpp" -#include "../../structure/others/sqrt-decomposition.hpp" -#include "../../structure/others/union-rectangle.hpp" - -int main() { - CumulativeSum sum(3); - sum.add(0, 2), sum.add(2, 5), sum.build(); - assert(sum.fold(0, 3) == 7); - - CumulativeSum2D sum_2d(2, 2); - sum_2d.add(0, 1, 3), sum_2d.add(1, 0, 4), sum_2d.build(); - assert(sum_2d.query(0, 0, 2, 2) == 7); - assert(edit_distance("kitten", "sitting") == 3); - assert(knapsack_01(std::vector{2}, std::vector{5}, 2, -1)[2] == 5); - assert(knapsack_01_2(std::vector{2}, std::vector{5}, 2) == 5); - assert(knapsack(std::vector{2}, std::vector{5}, 2, -1)[2] == 5); - assert(knapsack_limitations(std::vector{2}, std::vector{2}, - std::vector{5}, 4, -1)[4] == 10); - assert(largest_rectangle(std::vector{2, 1, 2}) == 3); - assert(longest_increasing_subsequence(std::vector{3, 1, 2}, true) == 2); - auto minima = monotone_minima( - 2, 2, [](int i, int j) { return (i - j) * (i - j); }); - assert(minima[0].first == 0 && minima[1].first == 1); - - Affine f(2, 3), g(4, 5); - assert(Affine::op(f, g).eval(1) == 25); - assert(RangeAddRangeMin::op(3, 1) == 1); - assert(RangeChminChmaxAddRangeSum::set(4).sum == 4); - - auto monoid = - LambdaMonoid([](int a, int b) { return a + b; }, [] { return 0; }); - assert(monoid.op(2, 3) == 5 && monoid.e() == 0); - auto act = LambdaAct([](int a, int b) { return a + b; }, [] { return 0; }); - assert(act.composition(2, 3) == 5 && act.id() == 0); - auto acted_monoid = - LambdaActedMonoid([](int a, int b) { return a + b; }, [] { return 0; }, - [](int x, int f) { return x + f; }, - [](int f, int g) { return f + g; }, [] { return 0; }); - assert(acted_monoid.mapping(2, 3) == 5); - auto beats = LambdaBeatsMonoid( - [](int a, int b) { return a + b; }, [](int) { return false; }, - [] { return 0; }, [](int x, int f) { return x + f; }, - [](int f, int g) { return f + g; }, [] { return 0; }); - assert(beats.mapping(2, 3) == 5 && !beats.fail(0)); - - SlopeTrick slope; - slope.add_abs(3); - assert(slope.get(3) == 0); - UnionRectangle rectangle; - rectangle.add_point(2, 3); - assert(rectangle.get() == 6); - SqrtDecomposition decomposition(2); - decomposition.build({0, 1}, {4, 5}); - assert(decomposition.query(0, 2, 1) == 5); - - assert(ceil_div(-5, 2) == -2 && floor_div(-5, 2) == -3); - Compress compress({3, 1, 3}); - compress.build(); - assert(compress.get(3) == 1 && compress[0] == 1); - assert(divisor(12) == std::vector({1, 2, 3, 4, 6, 12})); - assert(prime_factor(12)[2] == 2 && euler_phi(12) == 4); - assert(euler_phi_table(4) == std::vector({0, 1, 1, 2, 2})); - assert(moebius_table(4) == std::vector({1, 1, -1, -1, 0})); - assert(is_prime(97) && !is_prime(91)); - assert(kth_root_integer(1000, 3) == 10); - assert(convert_base(5, 2) == std::vector({1, 0, 1})); - assert(sum_of_floor_of_linear(4, 3, 1, 0) == 1); - assert(binomial_table(3)[3][1] == 3); - assert(montmort(4)[4] == 9); - assert(partition_table(4, 4)[4][4] == 5); - assert(sum_of_arithmetic_sequence(1, 2, 3) == 9); - assert(Enumeration::C(0, 0) == 1); - assert(binomial(5, 2) == 10); - assert(mod_pow(2, 10, 1000) == 24); - assert(mod_sqrt(4, 7) == 2 || mod_sqrt(4, 7) == 5); - assert(mod_log(2, 8, 13) == 3); - assert(mod_tetration(2, 3, 1000) == 16); - assert(prime_table(10)[7] && !prime_table(10)[9]); - assert(enumerate_primes(10) == std::vector({2, 3, 5, 7})); - assert(FastPrimeFactorization::prime_factor(84) == - std::vector({2, 2, 3, 7})); - StaticRangeFrequency frequency({1, 2, 1, 3, 1}); - assert(frequency.query(1, 5, 1) == 2); - - std::vector hadamard{1, 2, 3, 4}; - fast_walsh_hadamard_transform(hadamard); - fast_walsh_hadamard_transform(hadamard, true); - assert(hadamard == std::vector({1, 2, 3, 4})); - assert(bitwise_and_convolution(std::vector{1, 0, 0, 0}, - std::vector{1, 1, 1, 1}) - .size() == 4); - - Matrix matrix{{{1, 2}, {3, 4}}}; - assert(matrix.determinant() == -2); - Rational rational(2, 4); - assert(rational.numerator() == 1 && rational.denominator() == 2); - assert(manacher(std::string("aba"), false)[1] == 3); - ZAlgorithm z("ababa"); - assert(z.get()[2] == 3); - - Graph graph(3); - graph.add_edge(0, 1, 1); - graph.add_edge(1, 2, 2); - assert(bfs(graph, 0)[2] == 3); - assert(dijkstra(graph, 0).dist[2] == 3); - assert(bellman_ford(Edges{{0, 1, 1}, {1, 2, 2}}, 3, 0)[2] == 3); - std::vector> distances{{0, 1}, {1, 0}}; - warshall_floyd(distances, 100); - assert(distances[0][1] == 1); - std::vector grid{"S.", ".#"}; - assert(grid_bfs(grid, 'S')[0][1] == 1); - Graph dag(3); - dag.add_directed_edge(0, 1); - dag.add_directed_edge(1, 2); - assert(topological_sort(dag).size() == 3); - - BinaryBasis binary_basis; - assert(binary_basis.add(1) && binary_basis.add(2)); - assert(binary_basis.check(3) && binary_basis.size() == 2); - assert(cartesian_tree(std::vector{3, 1, 2})[0] == 1); - StaticRangeCountDistinct distinct({1, 2, 1, 3}); - distinct.add_query(0, 4); - assert(distinct.calclate_queries()[0] == 3); - PoyoPoyoPudding pudding; - assert(pudding.addLayer(50, 50) && pudding.eatTop()); - SuccinctIndexableDictionary dictionary(8); - dictionary.set(2), dictionary.set(5), dictionary.build(); - assert(dictionary.rank(6) == 2 && dictionary.rank(true, 4) == 1); - BinaryTrie binary_trie; - binary_trie.add(3), binary_trie.add(5); - assert(binary_trie.count(3) == 1 && binary_trie.min_element().first == 3); - Dinic dinic(2); - dinic.add_edge(0, 1, 3); - assert(dinic.max_flow(0, 1) == 3); - MoTree<> mo_tree(2); - mo_tree.add_edge(0, 1); - mo_tree.add(0, 1); - int mo_tree_adds = 0; - mo_tree.build([&](int) { mo_tree_adds++; }, [](int) {}, [](int) {}); - assert(mo_tree_adds == 3); - BipartiteMatching matching(2); - matching.add_edge(0, 1); - assert(matching.bipartite_matching() == 1); - Boruvka boruvka(2); - assert(boruvka.find(0) == 0); - FormalPowerSeriesFriendlyNTT series(2, modint998244353(1)); - assert(series.size() == 2); - - using geometry::Circle; - using geometry::Line; - using geometry::Point; - using geometry::Polygon; - using geometry::Segment; - Point a(0, 0), b(3, 4); - assert(geometry::distance(a, b) == 5); - assert(geometry::equals(geometry::cross(a, b), 0)); - Line line(a, b); - Segment segment(Point(0, 4), Point(3, 0)); - assert(geometry::is_intersect_ls(line, segment)); - assert(geometry::is_orthogonal(Line(Point(0, 0), Point(1, 0)), - Line(Point(0, 0), Point(0, 1)))); - Circle circle(Point(0, 0), 1); - assert(geometry::is_intersect_cp(circle, Point(1, 0))); - Polygon polygon{Point(0, 0), Point(2, 0), Point(0, 2)}; - assert(geometry::area(polygon) == 2); - assert(geometry::contains(polygon, Point(1, 1)) == geometry::ON); - std::vector hull = geometry::convex_hull(polygon); - assert(hull.size() == 3); - DecrementalUpperHull upper_hull( - std::vector>{{0, 0}, {1, 1}, {2, 0}}); - assert(upper_hull.size() == 3); - assert((convex_layers({{0, 0}, {1, 0}, {0, 1}}) == - std::vector({1, 1, 1}))); -} diff --git a/test/verify/aoj-0275.test.cpp b/test/verify/aoj-0275.test.cpp index a2783de4..954ced83 100644 --- a/test/verify/aoj-0275.test.cpp +++ b/test/verify/aoj-0275.test.cpp @@ -4,8 +4,9 @@ #include #include #include -#include "../../graph/shortest-path/dijkstra.hpp" + #include "../../graph/others/offline-dag-reachability.hpp" +#include "../../graph/shortest-path/dijkstra.hpp" using namespace std; diff --git a/test/verify/aoj-1254.test.cpp b/test/verify/aoj-1254.test.cpp index 272692b2..73302f3c 100644 --- a/test/verify/aoj-1254.test.cpp +++ b/test/verify/aoj-1254.test.cpp @@ -7,9 +7,9 @@ #include #include #include -#include "../../math/matrix/square-matrix.hpp" #include "../../graph/others/chromatic-number.hpp" +#include "../../math/matrix/square-matrix.hpp" using namespace std; diff --git a/test/verify/aoj-2270.test.cpp b/test/verify/aoj-2270.test.cpp index 76faa8a8..4367f321 100644 --- a/test/verify/aoj-2270.test.cpp +++ b/test/verify/aoj-2270.test.cpp @@ -7,7 +7,6 @@ #include #include "../../other/mo-tree.hpp" - #include "../../structure/others/binary-indexed-tree.hpp" using namespace std; diff --git a/test/verify/aoj-2306.test.cpp b/test/verify/aoj-2306.test.cpp index 6fcf7feb..692e5962 100644 --- a/test/verify/aoj-2306.test.cpp +++ b/test/verify/aoj-2306.test.cpp @@ -4,8 +4,8 @@ #include #include -#include "../../math/matrix/square-matrix.hpp" #include "../../graph/others/enumerate-cliques.hpp" +#include "../../math/matrix/square-matrix.hpp" using namespace std; diff --git a/test/verify/aoj-2405.test.cpp b/test/verify/aoj-2405.test.cpp index eb47d2c6..776aa1dc 100644 --- a/test/verify/aoj-2405.test.cpp +++ b/test/verify/aoj-2405.test.cpp @@ -7,9 +7,9 @@ #include #include #include -#include "../../math/combinatorics/montgomery-mod-int.hpp" #include "../../graph/others/tree-decomposition-width-2.hpp" +#include "../../math/combinatorics/montgomery-mod-int.hpp" using namespace std; diff --git a/test/verify/aoj-2450-5.test.cpp b/test/verify/aoj-2450-5.test.cpp index efa45bc8..1f7d7e3c 100644 --- a/test/verify/aoj-2450-5.test.cpp +++ b/test/verify/aoj-2450-5.test.cpp @@ -5,8 +5,8 @@ #include #include -#include "../../structure/dynamic-tree/lazy-link-cut-tree.hpp" #include "../../structure/dynamic-tree/dynamic-tree-builder-for-vertex.hpp" +#include "../../structure/dynamic-tree/lazy-link-cut-tree.hpp" using namespace std; diff --git a/test/verify/aoj-2450.test.cpp b/test/verify/aoj-2450.test.cpp index 514d902f..e8c1db92 100644 --- a/test/verify/aoj-2450.test.cpp +++ b/test/verify/aoj-2450.test.cpp @@ -8,9 +8,8 @@ #include #include -#include "../../structure/segment-tree/lazy-segment-tree.hpp" - #include "../../graph/tree/heavy-light-decomposition.hpp" +#include "../../structure/segment-tree/lazy-segment-tree.hpp" using namespace std; diff --git a/test/verify/aoj-2821.test.cpp b/test/verify/aoj-2821.test.cpp index 360b029c..f3a5fbae 100644 --- a/test/verify/aoj-2821.test.cpp +++ b/test/verify/aoj-2821.test.cpp @@ -4,9 +4,8 @@ #include #include -#include "../../structure/union-find/union-find.hpp" - #include "../../graph/tree/tree-isomorphism.hpp" +#include "../../structure/union-find/union-find.hpp" using namespace std; diff --git a/test/verify/aoj-3139.test.cpp b/test/verify/aoj-3139.test.cpp index 70d0c0bd..3b703195 100644 --- a/test/verify/aoj-3139.test.cpp +++ b/test/verify/aoj-3139.test.cpp @@ -6,10 +6,9 @@ #include #include -#include "../../structure/union-find/union-find.hpp" - #include "../../graph/others/block-cut-tree.hpp" #include "../../graph/tree/centroid-decomposition.hpp" +#include "../../structure/union-find/union-find.hpp" using namespace std; diff --git a/test/verify/yosupo-frequency-table-of-tree-distance.test.cpp b/test/verify/yosupo-frequency-table-of-tree-distance.test.cpp index 7f481df5..37a1a8ff 100644 --- a/test/verify/yosupo-frequency-table-of-tree-distance.test.cpp +++ b/test/verify/yosupo-frequency-table-of-tree-distance.test.cpp @@ -9,7 +9,6 @@ #include #include "../../graph/tree/centroid-decomposition.hpp" - #include "../../math/fft/fast-fourier-transform.hpp" using namespace std; diff --git a/test/verify/yosupo-k-shortest-walk.test.cpp b/test/verify/yosupo-k-shortest-walk.test.cpp index 9bcd5bab..cc24e41b 100644 --- a/test/verify/yosupo-k-shortest-walk.test.cpp +++ b/test/verify/yosupo-k-shortest-walk.test.cpp @@ -5,10 +5,9 @@ #include "../../graph/graph-template.hpp" #include "../../graph/shortest-path/dijkstra.hpp" - +#include "../../graph/shortest-path/k-shortest-walk.hpp" #include "../../structure/heap/leftist-heap.hpp" #include "../../structure/heap/persistent-leftist-heap.hpp" -#include "../../graph/shortest-path/k-shortest-walk.hpp" using namespace std; diff --git a/test/verify/yosupo-range-chmin-chmax-add-range-sum.test.cpp b/test/verify/yosupo-range-chmin-chmax-add-range-sum.test.cpp index 0abb8138..e62455c5 100644 --- a/test/verify/yosupo-range-chmin-chmax-add-range-sum.test.cpp +++ b/test/verify/yosupo-range-chmin-chmax-add-range-sum.test.cpp @@ -5,8 +5,8 @@ #include #include -#include "../../structure/segment-tree/segment-tree-beats.hpp" #include "../../structure/class/range-chmin-chmax-add-range-sum.hpp" +#include "../../structure/segment-tree/segment-tree-beats.hpp" using namespace std; diff --git a/test/verify/yosupo-tree-decomposition-width-2.test.cpp b/test/verify/yosupo-tree-decomposition-width-2.test.cpp index a9185010..f04eb494 100644 --- a/test/verify/yosupo-tree-decomposition-width-2.test.cpp +++ b/test/verify/yosupo-tree-decomposition-width-2.test.cpp @@ -5,13 +5,11 @@ #include #include -#include "../../other/scanner.hpp" +#include "../../graph/others/tree-decomposition-width-2.hpp" #include "../../other/printer.hpp" - +#include "../../other/scanner.hpp" #include "../../structure/union-find/union-find.hpp" -#include "../../graph/others/tree-decomposition-width-2.hpp" - using namespace std; int main() { diff --git a/test/verify/yukicoder-1720.test.cpp b/test/verify/yukicoder-1720.test.cpp index aa2a3b3c..fc7d8ca3 100644 --- a/test/verify/yukicoder-1720.test.cpp +++ b/test/verify/yukicoder-1720.test.cpp @@ -4,9 +4,8 @@ #include #include -#include "../../structure/others/permutation-tree.hpp" - #include "../../math/combinatorics/montgomery-mod-int.hpp" +#include "../../structure/others/permutation-tree.hpp" using namespace std; diff --git a/test/verify/yukicoder-502.test.cpp b/test/verify/yukicoder-502.test.cpp index 0ba59400..60873f40 100644 --- a/test/verify/yukicoder-502.test.cpp +++ b/test/verify/yukicoder-502.test.cpp @@ -3,9 +3,8 @@ #include #include -#include "../../math/combinatorics/montgomery-mod-int.hpp" #include "../../math/combinatorics/factorial.hpp" - +#include "../../math/combinatorics/montgomery-mod-int.hpp" #include "../../math/fft/arbitrary-mod-convolution.hpp" using namespace std; diff --git a/test/verify/yukicoder-650.test.cpp b/test/verify/yukicoder-650.test.cpp index 49045c69..92db41c1 100644 --- a/test/verify/yukicoder-650.test.cpp +++ b/test/verify/yukicoder-650.test.cpp @@ -5,11 +5,9 @@ #include #include "../../graph/tree/heavy-light-decomposition.hpp" - -#include "../../structure/segment-tree/segment-tree.hpp" - #include "../../math/combinatorics/montgomery-mod-int.hpp" #include "../../math/matrix/square-matrix.hpp" +#include "../../structure/segment-tree/segment-tree.hpp" using namespace std;