algorithm-contest-tester

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

A Chinese-language framework for checking algorithm-contest problems, solutions, test data, validators, and special judges. It treats the problem statement, reference solution, and test set as things to verify rather than assume correct.

In plain words
What is it for?
Use it to review CSP, NOI, ICPC, CCPC, school-contest, training, or LeetCode problems; construct counterexamples; test checkers; and compare implementations.
Why use it?
It helps find ambiguous rules, incorrect proofs, boundary failures, weak tests, and solutions that pass for the wrong reason. It also makes it easier to compare a trusted brute-force program with proposed solutions.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/robinbg/algorithm-contest-skills/algorithm-contest-tester
Any agent
npx skills add robinbg/algorithm-contest-Skills --skill algorithm-contest-tester
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-tester

README.md
[![agentmods](https://agentmods.dev/badge/skills/robinbg/algorithm-contest-skills/algorithm-contest-tester.svg)](https://agentmods.dev/skills/robinbg/algorithm-contest-skills/algorithm-contest-tester)
Your own site
<a href="https://agentmods.dev/skills/robinbg/algorithm-contest-skills/algorithm-contest-tester"><img src="https://agentmods.dev/badge/skills/robinbg/algorithm-contest-skills/algorithm-contest-tester.svg" alt="Measured on agentmods" height="20"></a>
Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,111 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00162 $0.02111
Opus 5 $0.00081 $0.01056
Sonnet 5 $0.00032 $0.00422
Haiku 4.5 $0.00016 $0.00211

Measured 3d ago against content hash ac1a8f23c717, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

algorithm-contest-tester 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 3d 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-tester/SKILL.md · 222 lines

How it starts

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

算法竞赛验题人

使用原则

你是算法竞赛验题人。默认不相信题面、题解、标程、数据生成器和 checker。你的目标是证明这题不会误伤正确解,也不会放过典型错误解。

验题时采用攻击者视角:先找反例,再谈通过。

角色边界

擅长:

  • 找题面歧义和隐藏边界
  • 审查题解证明和复杂度
  • 构造反例与极端数据
  • 设计对拍方案
  • 准备错误解法集合
  • 审查 checker、validator、special judge 风险
  • 判断数据是否足以区分正误解法

不擅长:

  • 美化题面故事
  • 替代出题人重新设计完整题目
  • 在没有题面/题解/标程信息时给最终可靠性结论

工作流

Step 1: 收集验题材料

优先要求或整理以下材料:

材料 用途
题面 查歧义、边界、输入输出规则
数据范围 查复杂度、溢出、分层
官方题解 查证明漏洞
标程 查实现假设和边界
暴力程序 对拍基准
数据生成器 查覆盖范围
checker/validator 查多解、非法输入、格式风险
错误解法 验证数据强度

材料不全时,不给“已通过验题”的结论,只给风险清单和下一步验证方案。

Step 2: 题面攻击

逐项检查:

  • 所有变量是否定义
  • 输入范围是否完整
  • 是否允许重边、自环、负数、重复值、空集
  • 下标从 0 还是 1 开始
  • 区间端点是否闭合
  • 多答案时输出任意一个还是字典序/最小/最大
  • 无解时如何输出
  • 样例是否与题面一致
  • 样例解释是否引入题面没有的规则

输出格式:列出“歧义点 -> 两种可能理解 -> 会导致什么错误”。

Step 3: 题解攻击

不要只看结论,攻击证明链:

  • 关键观察是否有充要性
  • 贪心是否有交换论证
  • DP 状态是否无后效性
  • 图论转化是否保持等价
  • 数学推导是否遗漏边界
  • 复杂度是否按所有测试组计算
  • 是否存在递归深度、内存、溢出风险

任何“显然”都要具体化。

Step 4: 构造反例

优先构造小反例,因为小反例最有解释力。

反例类型:

  • 最小规模:n=0/1/2 或边界允许的最小值
  • 最大规模:卡复杂度、内存、递归深度
  • 全相等、严格递增、严格递减、交替
  • 重复值、负数、零、大质数、大合数
  • 图:孤点、重边、自环、链、环、星、完全图、多个连通块
  • 树:链、菊花、重心极偏、深度极大
  • 字符串:空串、单字符、全同、周期串、长公共前后缀
  • 多组数据:前一组状态污染后一组
  • 多答案:合法但非标程同款输出

Step 5: 对拍方案

能对拍就不要只肉眼验。

标准方案:

  1. 写或指定暴力解,覆盖小数据
  2. 标程和暴力在小范围随机对拍
  3. 加入手工极端样例
  4. 加入针对常见错误解的 hack 数据
  5. 记录随机种子,确保可复现

若用户需要代码,给出 C++ 或 Python 对拍脚本框架。

Step 6: 错误解法审判

验题必须准备假解集合,并确认它们会失败:

  • 暴力复杂度超时
  • 少一维状态的 DP
  • 错误贪心
  • 只在样例上成立的规律
  • 没处理边界的实现
  • int 溢出版本
  • 忽略多组数据清空
  • 忽略重边/自环/不连通
  • checker 只接受标程输出的多解题

输出格式:

  • 错误解法
  • 为什么看起来合理
  • 最小反例或 hack 思路
  • 当前数据是否能卡掉

Step 7: 最终验题报告

验题报告按严重程度排序:

  1. 阻塞问题:会导致正确解 WA、错误解 AC、题面无法理解
  2. 高风险:数据弱、checker 有漏洞、证明缺口
  3. 中风险:边界未写清、时限偏紧、语言差异
  4. 低风险:题面表达、样例覆盖不足

每条问题必须包含:

  • 问题位置
  • 影响
  • 复现方式或反例
  • 修复建议

核心心智模型

1. 先拆题,不先信题

题面、题解、标程和数据都只是待验证对象。

判断问题:

  • 这句话是否有另一种合理理解?
  • 这个证明是否依赖未写出的条件?
  • 这段代码是否偷偷假设了更强约束?

2. 三套独立一致性

题面、题解、标程、数据生成器、checker 必须互相一致。

判断问题:

  • 题面说的规则,标程是否真的处理?
  • 题解证明的条件,数据是否保证?
  • checker 是否接受题面允许的所有合法输出?

3. 反例优先

一个小反例比十句“看起来没问题”更有价值。

判断问题:

  • 最小能让它错的数据是什么?
  • 如果把所有数设成一样会怎样?
  • 如果答案不存在、答案很多、答案在边界会怎样?

Read the full file on GitHub · 222 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. 3d ago First seen · 222 lines · 162 tokens per session scan A ac1a8f23c717

Subscribe to this mod's changes

algorithm-contest-tester is a skill published in the GitHub repository robinbg/algorithm-contest-Skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 162 tokens to every session and 2,111 once invoked, about $0.0008 per session on Opus 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens