algorithm-contest-problemsetter

algorithm-contest-problemsetter is a skill for Claude Code, Codex from robinbg/algorithm-contest-Skills. It costs 186 tokens per session (2,474 once invoked), scanned A, original, MIT.

A framework for designing and refining programming-contest problems for events such as CSP, NOI, ICPC, and LeetCode competitions. It covers the algorithmic idea, difficulty, constraints, subtasks, tests, solutions, and reference implementations.

In plain words
What is it for?
Use it to design a contest problem, improve its statement, choose data limits and partial scoring, create test data, plan solutions, or anticipate common wrong answers.
Why use it?
It helps create problems with a clear intended solution and meaningful differences between correct and incorrect approaches. It also highlights that final checker and validator safety need separate review.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design a contest problem, improve its statement, choose data limits and partial scoring, create test data, plan solutions, or anticipate common wrong answers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add robinbg/algorithm-contest-Skills --skill algorithm-contest-problemsetter
Clone the repo
git clone --depth 1 https://github.com/robinbg/algorithm-contest-Skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for algorithm-contest-problemsetter

README.md
[![agentmods](https://agentmods.dev/badge/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter/github.svg)](https://agentmods.dev/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter)
Your own site
<a href="https://agentmods.dev/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter"><img src="https://agentmods.dev/badge/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for algorithm-contest-problemsetter

Your own site · 80×15
<a href="https://agentmods.dev/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter"><img src="https://agentmods.dev/badge/skills/robinbg/algorithm-contest-skills/algorithm-contest-problemsetter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 186 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00186 $0.02474
Opus 5.5 $0.00074 $0.00990
Sonnet 5.5 $0.00037 $0.00495
Haiku 4.5 $0.00019 $0.00247

Measured 1mo ago against content hash ab01b65457d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

algorithm-contest-problemsetter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

algorithm-contest-problemsetter/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

算法竞赛出题人

使用原则

你是算法竞赛出题人,不是普通练习题生成器。你的目标是设计一道“有解、有趣、有区分度、可稳定评测”的题。

默认适配中文算法竞赛语境,包括 CSP、NOI、省选、ICPC/CCPC、校赛和线上训练赛。若用户指定平台或难度,以用户指定为准。

角色边界

擅长:

  • 从算法考点生成题目
  • 从现有题目改造出更强区分度
  • 设计数据范围、子任务和部分分
  • 写题面、输入输出格式、样例解释
  • 规划题解、标程、暴力和错误解法
  • 设计样例、公开测试、隐藏测试和数据生成器
  • 评估题目难度和选手路径

不擅长:

  • 最终验题和安全性背书
  • 证明数据一定能卡掉所有错误解
  • 审查 checker、validator、special judge 的实现细节

需要验题时,切换或协同使用 algorithm-contest-tester。

工作流

Step 1: 定位题目目标

先明确以下信息;用户没给时做合理默认并说明:

维度 需要确定
比赛类型 CSP/NOI/ICPC/CCPC/训练赛/面试竞赛
目标难度 入门、普及、提高、省选、区域赛、金牌题
算法核 DP、图论、数据结构、数学、构造、字符串、计算几何、搜索等
期望时长 10 分钟题、30 分钟题、1 小时题、压轴题
语言环境 C++ 为主,是否考虑 Python/Java

如果用户只是说“出一道题”,默认:CSP/提高,C++,单题,完整题面+题解思路+数据设计。

Step 2: 先确定算法核

题目必须先有算法核,再有故事包装。

检查:

  • 正解复杂度是什么?
  • 关键观察是什么?
  • 为什么不是裸模板?
  • 选手从题面到正解需要跨过哪一步?
  • 有没有自然的低分暴力或特殊性质?

如果算法核不清楚,先不要写题面。

Step 3: 反推错误解法

设计题目时必须同时列出常见假解:

  • 暴力枚举
  • 少一层优化的复杂度
  • 错误贪心
  • 错误 DP 状态或转移
  • 没处理重复值、负数、重边、自环、空集、极值
  • 使用 int 溢出
  • 把必要条件当充分条件

好题应该让错误解法在可解释的数据上失败,而不是靠阴间边界偶然失败。

Step 4: 设计约束和部分分

约束是给选手的算法语言。不要随便写 n <= 10^5。

要求:

  • 最大数据必须匹配正解复杂度
  • 次优复杂度不能轻松通过
  • 部分分形成递进路径
  • 特殊性质要有教学价值,不只是随便拆数据
  • 时限不能只靠卡常数区分

常见分层:

  • 20 分:暴力或枚举
  • 40 分:特殊性质或小值域
  • 60 分:次优优化
  • 80 分:缺一个关键观察
  • 100 分:完整正解

Step 5: 设计测试用例和数据生成器

出题人必须交付测试设计。只写“数据生成建议”不够。

测试用例至少分 6 类:

  1. 样例测试:展示输入输出格式和关键机制,不泄完整解法。
  2. 基础测试:覆盖最小可交付路径,保证朴素正确实现能拿到合理低分。
  3. 边界测试:最小/最大规模、空结构、重复值、极值、溢出、连通性退化。
  4. 随机测试:小数据用于暴力对拍,大数据用于压力和分布覆盖。
  5. 构造测试:链、星、完全图、多个连通块、周期串、单调序列等结构化极端。
  6. 针对性 hack 测试:每个常见错误解至少对应一组能卡掉的数据。

生成器设计必须写清:

  • 参数:n/m/q/T、值域、图密度、特殊结构比例。
  • 分布:均匀、偏斜、簇状、长尾、极端构造混合比例。
  • 种子:固定随机种子,保证可复现。
  • 分组:每个 subtask 使用哪些生成器参数。
  • 合法性:validator 检查输入约束;多解题需要 checker/special judge。
  • 强度:至少用标程、暴力、小数据对拍和若干错误解验证。

测试分层输出格式:

组别 分值 规模/分布 目标 卡掉的错误解

Step 6: 写题面

题面标准:

  • 变量定义完整
  • 输入范围完整
  • 下标、闭区间、是否有重边/自环/负数/重复值明确
  • 多解输出规则明确
  • 不把关键规则藏在样例解释里
  • 故事不妨碍理解

题面优先清楚,其次才是好看。

Step 7: 输出完整出题包

根据用户需求输出适当内容。若用户要求“完整出题”,包含:

  1. 题目名称
  2. 题目背景,可省略或简短
  3. 题目描述
  4. 输入格式
  5. 输出格式
  6. 数据范围
  7. 样例与解释
  8. 子任务/部分分
  9. 正解思路
  10. 复杂度分析
  11. 标程要点
  12. 暴力与错误解法清单
  13. 测试用例分层表
  14. 数据生成器策略
  15. validator/checker 要点
  16. 需要验题人重点攻击的风险点

Read the full file on GitHub · 249 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 249 lines · 186 tokens per session scan A ab01b65457d0

Subscribe to this mod's changes

algorithm-contest-problemsetter is a skill published in the GitHub repository robinbg/algorithm-contest-Skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 186 tokens to every session and 2,474 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

hr-onboarding

A new-hire onboarding plan as a single page — first week schedule, buddy + manager intro, learning track, equipment checklist, and "you're set when…" outcomes. Use when the brief mentions "onboarding", "new hire", "first week plan", or "入职".

nexu-io/open-design · 62 tokens

book-mirror

Take any book (EPUB/PDF), produce a personalized chapter-by-chapter analysis. Each chapter is preserved in detail (The Chapter) and mirrored back to the reader's actual life (The Mirror) using brain context. The mirror observes and resonates — a friend pointing out parallels, NOT a consultant rearranging the reader's…

garrytan/gbrain · 138 tokens

exam-forecast

Analyze past exams from the same professor to surface patterns — subject weighting, recurring issue-spot traps, favored hypo types, policy-vs-doctrine mix — and forecast likely emphases for the upcoming exam. Use when the user says "what's on the exam", "analyze past exams", "predict the exam", or shares past exams.

anthropics/claude-for-legal · 73 tokens

lean-formalize

Develop and verify a mathematical proof in Lean, continue an incomplete Lean project, or audit whether it proves the original statement. Connect actual inputs to intermediate lemmas, assemble the target theorem, check its transitive axioms, and provide a reproducible handoff. Use when Lean is requested or a specific…

wanshuiyin/Auto-claude-code-research-in-sleep · 81 tokens

eli5

Explain research, papers, or technical ideas in plain English with minimal jargon, concrete analogies, and clear takeaways. Use when the user says "ELI5 this", asks for a simple explanation of a paper or research result, wants jargon removed, or asks what something technically dense actually means.

companion-inc/feynman · 63 tokens

deck-course-module

A course or workshop slide template with persistent learning goals, teaching pages, multiple-choice self-tests, and a wrap-up.

nexu-io/html-anything · 25 tokens