Datasets:
|
Download README.md from xupy21/Category_Data: direct link, hf CLI and curl.
- Browser
- Download file 11.7 kB
-
https://huggingface.co/datasets/xupy21/Category_Data/resolve/main/README.md
- Command line
-
hf download hf://datasets/xupy21/Category_Data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/xupy21/Category_Data/resolve/main/README.md
11.7 kB
| license: other | |
| language: | |
| - en | |
| task_categories: | |
| - text-generation | |
| tags: | |
| - code | |
| - competitive-programming | |
| - icpc | |
| - atcoder | |
| - algorithms | |
| - reasoning | |
| - llm-evaluation | |
| size_categories: | |
| - n<1K | |
| configs: | |
| - config_name: manifest | |
| data_files: manifest.csv | |
| # Competitive programming problems by algorithm category | |
| 967 problems, **157 from the ICPC World Finals (2011–2025)** and **810 from AtCoder | |
| (ABC / ARC / AGC, difficulty ≥ 1200)**, each tagged with 1–3 categories from a | |
| 31-category algorithm taxonomy and stored under its primary category. Every problem can | |
| be judged locally. It ships with: | |
| - its statement; | |
| - its official test data; | |
| - an editorial; | |
| - a C++ reference solution that passes every test; | |
| - a `judge.json` with the resolved time limit, memory limit and judging mode. | |
| ## Categories | |
| Each problem appears **once**, under its **primary category**, which is the first of its | |
| labels. Its full label set (1–3 ids) is in `manifest.csv` / `manifest.jsonl`. | |
| `taxonomy.md` defines every category and gives the boundary rules used to label them. | |
| | ID | Family | Category | Problems | ICPC | AtCoder | | |
| |---|---|---|---:|---:|---:| | |
| | MA-01 | Mathematics | Math Reasoning / Formulas | 91 | 18 | 73 | | |
| | MA-02 | Mathematics | Number Theory | 46 | 2 | 44 | | |
| | MA-03 | Mathematics | Combinatorics & Probability | 88 | 4 | 84 | | |
| | MA-04 | Mathematics | Game Theory | 36 | 4 | 32 | | |
| | MA-05 | Mathematics | Bitwise / XOR | 20 | 1 | 19 | | |
| | MA-06 | Mathematics | Linear Algebra / Polynomials | 39 | 7 | 32 | | |
| | MA-07 | Mathematics | Geometry | 31 | 23 | 8 | | |
| | DS-01 | Data Structures | Prefix Sums / Difference Arrays | 9 | 2 | 7 | | |
| | DS-02 | Data Structures | Hash / Set / Map | 3 | 0 | 3 | | |
| | DS-03 | Data Structures | Stack / Queue / Heap | 4 | 1 | 3 | | |
| | DS-04 | Data Structures | Segment Tree / Fenwick / BST | 20 | 0 | 20 | | |
| | DS-05 | Data Structures | DSU / Union-Find | 15 | 2 | 13 | | |
| | DP-01 | Dynamic Programming | Linear / Sequence DP | 91 | 10 | 81 | | |
| | DP-02 | Dynamic Programming | Knapsack / Subset / Bitmask DP | 53 | 5 | 48 | | |
| | DP-03 | Dynamic Programming | Tree / DAG DP | 26 | 6 | 20 | | |
| | DP-04 | Dynamic Programming | DP Optimization | 84 | 6 | 78 | | |
| | GR-01 | Graph Theory | Traversal / Connectivity | 42 | 11 | 31 | | |
| | GR-02 | Graph Theory | Shortest Paths / MST | 27 | 5 | 22 | | |
| | GR-03 | Graph Theory | Flow / Matching | 31 | 5 | 26 | | |
| | GR-04 | Graph Theory | Tree Algorithms | 11 | 0 | 11 | | |
| | ST-01 | Strings | Pattern Matching / String Hashing | 4 | 2 | 2 | | |
| | ST-02 | Strings | Trie / Suffix Structures | 10 | 2 | 8 | | |
| | PA-01 | Algorithmic Paradigms | Greedy | 51 | 13 | 38 | | |
| | PA-02 | Algorithmic Paradigms | Binary / Ternary Search | 12 | 2 | 10 | | |
| | PA-03 | Algorithmic Paradigms | Two Pointers / Sliding Window / Sweep Line | 16 | 2 | 14 | | |
| | PA-04 | Algorithmic Paradigms | Divide & Conquer / Sqrt Decomposition | 8 | 1 | 7 | | |
| | PA-05 | Algorithmic Paradigms | Brute Force / Search | 24 | 7 | 17 | | |
| | AH-01 | Ad-hoc & Implementation | Ad-hoc / Observation / Case Work | 69 | 13 | 56 | | |
| | AH-02 | Ad-hoc & Implementation | Constructive | 3 | 1 | 2 | | |
| | AH-03 | Ad-hoc & Implementation | Implementation / Simulation | 3 | 2 | 1 | | |
| | | | **Total** | **967** | **157** | **810** | | |
| The 31st category, AH-04 (Interactive), is never a primary label. It appears only as a | |
| secondary label, on the 4 interactive ICPC problems. `categories.json` lists every category | |
| with its problem ids. It also gives `any_label_count`, the number of problems that carry | |
| the category at any position. | |
| ### How the labels were made | |
| The labels come from an LLM; no human assigned them. | |
| 1. **Labeling.** GPT-6-Astra read each problem's statement, editorial and reference | |
| solution, along with the taxonomy and its boundary rules. It returned 1–3 category ids. | |
| 2. **Voting.** Each problem was sampled 3 times, with the category order shuffled between | |
| samples, and the majority vote was kept. | |
| 3. **Adjudication.** Where the 3 samples disagreed (160 problems), a second model (Claude) | |
| chose the final set from the samples and the problem. | |
| The `label_source` field records which path a problem took: `model_unanimous` (807 | |
| problems) or `adjudicated` (160). Label counts per problem: 193 problems have 1 label, 509 | |
| have 2 and 265 have 3. | |
| ## The problems | |
| ### ICPC World Finals (157) | |
| The source is every World Finals problem from 2011 to 2025 in the archive, except: | |
| - **9 problems that accept several correct answers but have no checker**: 2012/E, | |
| 2014/A, 2014/I, 2015/E, 2017/G, 2017/J, 2017/L, 2018/H and 2018/K. Comparing a | |
| submission's output against the answer file would reject correct submissions. | |
| - **3 problems whose archive reference solution was wrong**: 2019/B, 2020/K and 2020/L. | |
| - **5 problems shared by WF 2022 and WF 2023**: Turning Red, Bridging the Gap, Carl's | |
| Vacation, Three Kinds of Dice and Riddle of the Sphinx. They have identical test data and | |
| references, and each is kept once, as its 2023 copy. | |
| | File | What it is | | |
| |---|---| | |
| | `statement.pdf` | the official statement | | |
| | `statement.txt` | the PDF's text, checked line by line against the PDF and corrected (superscripts, ≠, fractions, floor/ceil, formulas) | | |
| | `page.html` | the archive page | | |
| | `solution.cpp`, `solution.tex` | the reference solution and its write-up (observations, algorithm, proof, complexity). These are the official archive's for 70 problems (2019–2025). For the other 87, mostly 2011–2018, the archive serves only a template. Their solution was written by GPT-6-Astra, accepted on the full official data, and the write-up was then written in the archive's `solution.tex` format. `solution_source` in the manifest says which. | | |
| | `meta.json` | year, letter, title, slug and page range in the contest PDF | | |
| | `data/` | official test data: `sample-*` and `secret-*` `.in`/`.ans`, plus sample figures and descriptions, and testing tools for the interactive problems | | |
| ### AtCoder (810) | |
| The source is ABC, ARC and AGC tasks with an estimated difficulty of at least 1200 (from | |
| AtCoder Problems) and an English editorial: 477 ABC, 259 ARC and 74 AGC, with difficulty | |
| from 1202 to 4310 (median 2150). | |
| Only tasks that AtCoder judges by exact, case-sensitive token comparison are kept. That | |
| drops: | |
| - interactive tasks; | |
| - tasks with a floating-point tolerance; | |
| - tasks that accept several answers, including 8 construction tasks found while writing | |
| references; | |
| - tasks with case-insensitive checkers. | |
| | File | What it is | | |
| |---|---| | |
| | `statement.md` | the English task page in Markdown with LaTeX; the samples are part of it | | |
| | `editorial.md` | the official English editorial with all code removed (programs, pseudocode, submission links) | | |
| | `solution.cpp` | C++ reference, accepted on every test: 233 are the editorial's own code, 577 were written by GPT-6-Astra from the editorial. The header comment and `solution_source` say which. | | |
| | `meta.json` | task id, contest, URL, estimated difficulty, score, limits, editorial URL | | |
| | `data/` | official test data, `N.in` / `N.out`. There is no sample/secret split; the samples are among the numbered tests. | | |
| 278 of the AtCoder references `#include <atcoder/...>`. To compile them, put the | |
| [AtCoder Library](https://github.com/atcoder/ac-library) on the include path, as | |
| AtCoder's own judge does. | |
| ## Judging | |
| Each problem directory has a `judge.json`: | |
| ```json | |
| { | |
| "time_limit_s": 4.0, | |
| "time_limit_source": "statement", | |
| "memory_mb": 2048, | |
| "memory_source": "default (the statement gives none)", | |
| "mode": "float", | |
| "validator_flags": "float_absolute_tolerance 0.001 float_relative_tolerance 1e-05", | |
| "comparison": "Kattis default output validator: token-wise, whitespace- and case-insensitive, numbers within the flagged tolerance", | |
| "validator": null, | |
| "tests_dir": "data", | |
| "answer_suffix": ".ans", | |
| "n_sample": 2, | |
| "n_secret": 44 | |
| } | |
| ``` | |
| | `mode` | Problems | How | | |
| |---|---:|---| | |
| | `exact` | 911 | Token comparison of the output against the answer file. ICPC uses the Kattis default validator, which ignores case. AtCoder is case-sensitive (`validator_flags: case_sensitive`). | | |
| | `float` | 40 | Kattis default validator with the tolerance in `validator_flags`. When both an absolute and a relative bound are given, a difference within either one is accepted. | | |
| | `custom` | 12 | ICPC problems with more than one correct answer. `validator` names a checker under `problems/_verify/checkers/`. It uses the Kattis output-validator protocol: argv `input answer feedback_dir`, the submission's output on stdin, exit 42 for accept and 43 for reject. | | |
| | `interactive` | 4 | ICPC interactive problems. `validator` names the interactor under `problems/_verify/interactors/`. It is connected to the submission over a pair of pipes and uses the same exit codes. | | |
| Where the limits come from: | |
| - **AtCoder**: time and memory limits come from the task page. | |
| - **ICPC, time**: the time limit is parsed from the statement. 22 statements (all of 2011 and | |
| 2012) print none and use a default of 10 s. | |
| - **ICPC, memory**: World Finals statements state no memory limit, so 2048 MB is used. | |
| The checkers import `problems/_verify/checkers/wfcheck.py`, so keep the `_verify/` | |
| tree together. `problems/_verify/judging.json` records the non-default modes, keyed by | |
| `<year>/<letter>`. | |
| ## Contents | |
| ``` | |
| README.md | |
| manifest.csv # one row per problem (the `manifest` config); list fields joined with ';' | |
| manifest.jsonl # the same records as JSON | |
| categories.json # category -> family, name, counts, any_label_count, problem ids | |
| taxonomy.md # the 31 categories, what each includes, and the boundary rules | |
| problems/<CAT>/ICPC_WF/<year>/<L-slug>/ | |
| statement.txt statement.pdf page.html solution.cpp solution.tex meta.json judge.json | |
| data/ # sample-*.in|.ans, secret-*.in|.ans | |
| problems/<CAT>/Atcoder/<task_id>/ | |
| statement.md editorial.md solution.cpp meta.json judge.json | |
| data/ # 1.in|.out, 2.in|.out, ... | |
| problems/_verify/ | |
| judging.json checkers/ interactors/ | |
| ``` | |
| Manifest fields: | |
| | Field | Meaning | | |
| |---|---| | |
| | `id` | `ICPC_WF/<year>/<L-slug>` or `Atcoder/<task_id>` | | |
| | `source` | `ICPC_WF` or `Atcoder` | | |
| | `primary_category`, `primary_category_name`, `family` | the problem's primary category | | |
| | `labels`, `label_names` | all 1–3 labels, in order | | |
| | `label_source` | `model_unanimous` or `adjudicated` (see above) | | |
| | `title`, `year`, `letter`, `contest`, `contest_type`, `difficulty`, `url` | where the problem comes from; `difficulty` is AtCoder only | | |
| | `solution_source`, `editorial_source` | official or model-written (see above) | | |
| | `time_limit_s`, `memory_mb`, `judge_mode`, `n_tests` | from `judge.json` | | |
| | `problem_dir` | path of the problem's directory | | |
| ## Download | |
| The dataset is about 58 GB, almost all of it AtCoder test data. To fetch one category, or | |
| everything except test data: | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| # the top-level files and one category, test data included | |
| snapshot_download("xupy21/Category_Data", repo_type="dataset", | |
| allow_patterns=["README.md", "manifest.*", "categories.json", "taxonomy.md", | |
| "problems/MA-07/*", "problems/_verify/*"]) | |
| # everything except test data: statements, editorials, references, judge.json | |
| snapshot_download("xupy21/Category_Data", repo_type="dataset", | |
| ignore_patterns=["*/data/*"]) | |
| ``` | |
| ## Sources | |
| The statements, editorials and test data come from the ICPC World Finals archive and from | |
| AtCoder (atcoder.jp); their rights stay with ICPC, AtCoder and the problem authors. The | |
| model-written references and write-ups are marked as such in `solution_source` and | |
| `editorial_source`. | |