競技プログラミングのためのアルゴリズム集¶
このプロジェクトの目的は、競技プログラミングで特によく使われる多数のアルゴリズムや データ構造を解説している優れた資料 https://e-maxx.ru/algo を翻訳することです。 さらに、既存の記事を拡充したり、新しい記事を追加したりすることで、 蓄積された知識そのものも発展させたいと考えています。
このサイトは広告なし・ボランティア運営で、誰でも無料で利用できます。 記事の寄稿や、より幅広いアルゴリズム解説のための支援を通じて協力できます。 ご協力に感謝します。
公開ページは https://cp-algorithms.com/ です。
寄稿する¶
支援する¶
Cloudflare Pages で公開する¶
このリポジトリは静的サイトとしてそのまま Cloudflare Pages に載せられます。
mkdocs build の出力先は public/、Pages 向けの設定は wrangler.jsonc に入っています。
Git 連携で公開する¶
Cloudflare Dashboard で Workers & Pages → Create → Pages を選び、このリポジトリを接続してください。
ビルド設定は次の通りです。
- Build command:
pip install -r requirements.txt && mkdocs build - Build output directory:
public - Environment variable:
SITE_URL=https://<your-domain-or-pages-subdomain>
必要なら、記事ごとの Git 情報を出すための以下も設定できます。
MKDOCS_ENABLE_GIT_REVISION_DATE=trueMKDOCS_ENABLE_GIT_COMMITTERS=trueMKDOCS_GIT_COMMITTERS_APIKEY=<GitHub token>MKDOCS_GIT_COMMITERS_BRANCH=main
Wrangler で直接デプロイする¶
npm install -D wranglernpx wrangler loginpip install -r requirements.txtSITE_URL=https://<your-project>.pages.dev mkdocs buildnpx wrangler pages deploy public
初回にプロジェクトが未作成なら、先に npx wrangler pages project create を実行してください。
更新履歴¶
- August, 2025: Overhaul of CP-Algorithms donation system. Please consider supporting us, so that we can grow!
- August, 2025: Launched a Discord server!
- October, 2024: Welcome new maintainers: jxu, mhayter and kostero!
- October, 15, 2024: GitHub pages based mirror is now served at https://gh.cp-algorithms.com/, and an auxiliary competitive programming library is available at https://lib.cp-algorithms.com/.
- July 16, 2024: Major overhaul of the Finding strongly connected components / Building condensation graph article.
- June 26, 2023: Added automatic RSS feeds for new articles and updates in articles.
- December 20, 2022: The repository name and the owning organizations were renamed! Now the repo is located at https://github.com/cp-algorithms/cp-algorithms. It is recommended to update the upstream link in your local repositories, if you have any.
- October 31, 2022: It is now possible to select and copy $\LaTeX$ source code of formulas within the articles.
- June 8, 2022: Tags are enabled. Each article is now marked whether it is translated or original, overall tag info is present in the tag index. For translated articles, clicking on
From: Xtag would lead to the original article. - June 7, 2022: Date of last commit and author list with contribution percentage is tracked for each page.
- June 5, 2022: Enabled content tabs and sidebar navigation. The navigation is moved to a separate page and its structure should be adjusted in navigation.md whenever a new article is created or an old one is moved.
- January 16, 2022: Switched to the MkDocs site generator with the Material for MkDocs theme, which give the website a more modern look, brings a couple of new features (dark mode, better search, ...), makes the website more stable (in terms of rendering math formulas), and makes it easier to contribute.
新着記事¶
- (9 June 2026) Minimum cut - Stoer-Wagner algorithm
- (28 March 2026) Centroid decomposition
- (19 August 2025) Minimum Enclosing Circle
- (21 May 2025) Simulated Annealing
- (12 July 2024) Manhattan distance
- (8 June 2024) Knapsack Problem
- (28 January 2024) Introduction to Dynamic Programming
- (8 December 2023) Hungarian Algorithm
- (10 September 2023) Tortoise and Hare Algorithm
- (12 July 2023) Finding faces of a planar graph
- (18 April 2023) Bit manipulation
- (17 October 2022) Binary Search
- (17 October 2022) MEX (Minimum Excluded element in an array)
- (12 May 2022) Factoring Exponentiation
- (7 May 2022) Knuth's Optimization
- (31 March 2022) Continued fractions
更新一覧: Commit History
記事一覧: Navigation