演算法模板、題目練習與比賽紀錄,以 C++ 撰寫。
.
├── template/ # 演算法模板
│ ├── default.cpp # 比賽預設模板
│ ├── (graph)
│ ├── (data structure)
│ ├── (string)
│ ├── (math)
│ └── (misc)
├── topic/ # 依主題分類的題目練習
│ ├── 2-sat/
│ ├── blossom/
│ ├── divide-and-conquer/
│ ├── euler-path/
│ ├── flow/
│ ├── game-theory/
│ ├── segment-tree/
│ ├── string/
│ └── sweepline/
└── contest/ # 比賽紀錄
├── codeforces/
│ ├── 900-div2/ # Round 900 (Div. 2)
│ ├── 160-edu/ # Educational Round 160
│ └── 25-global/ # Global Round 25
├── atcoder/
│ ├── 350-abc/ # AtCoder Beginner Contest 350
│ └── 180-arc/ # AtCoder Regular Contest 180
└── leetcode/
├── 400-weekly/ # Weekly Contest 400
└── 130-biweekly/ # Biweekly Contest 130
每場比賽一個資料夾,檔案用題號命名。
Codeforces (contest/codeforces/)
檔案命名:A.cpp, B.cpp, C.cpp, ...
比賽類型
資料夾格式
範例
Div. 1
{number}-div1
901-div1/
Div. 2
{number}-div2
900-div2/
Educational
{number}-edu
160-edu/
Global Round
{number}-global
25-global/
其他
{number}-{name}
2024-hello/
AtCoder (contest/atcoder/)
檔案命名:A.cpp, B.cpp, C.cpp, ...
比賽類型
資料夾格式
範例
ABC
{number}-abc
350-abc/
ARC
{number}-arc
180-arc/
AGC
{number}-agc
065-agc/
LeetCode (contest/leetcode/)
檔案命名:Q1.cpp, Q2.cpp, Q3.cpp, Q4.cpp
比賽類型
資料夾格式
範例
Weekly
{number}-weekly
400-weekly/
Biweekly
{number}-biweekly
130-biweekly/
建立新比賽資料夾 (自動複製模板 + Makefile):
# PowerShell
.\s cripts\n ew-contest.ps1 cf 900-div2 # Codeforces Div.2 Round 900 (預設 7 題)
.\s cripts\n ew-contest.ps1 at 350-abc # AtCoder ABC 350
.\s cripts\n ew-contest.ps1 lc 400-weekly # LeetCode Weekly 400 (預設 4 題)
.\s cripts\n ew-contest.ps1 cf 900-div2 8 # 指定題數
# Bash / WSL
./scripts/new-contest.sh cf 900-div2
編譯與執行 (進入比賽資料夾後):
make A # 編譯 A.cpp → A
make run T=A # 編譯並執行 A
make all # 編譯所有 .cpp
make clean # 清除執行檔
Blossom — 一般圖匹配 (topic/blossom/)
Divide and Conquer — 分治 (topic/divide-and-conquer/)
Euler Path — 尤拉路徑 (topic/euler-path/)
Game Theory — 博弈論 / SG (topic/game-theory/)
Segment Tree — 線段樹 (topic/segment-tree/)
String — 字串 (topic/string/)
Sweepline — 掃描線 (topic/sweepline/)