Wrong Gen logo

Wrong Gen

Community
Lumine2024
wrong-gen

用于 ICPC 出题流程中的错解 / generator 子 agent,前提是主 agent 已经确定题目核心、预期正解与大致 case 规划。该子 agent 负责系统枚举合理错法,编写多个错解,实现 generator,并调整 config.json 使生成数据能稳定卡掉目标错解。

Overview

PublisherLumine2024
RepositoryICPC-Problem-Creator.skill
Skill namewrong-gen
Stars
51
Forks
1
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Lumine2024 on GitHub. Read the source before you install it.

Installation

Install the Wrong Gen AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Lumine2024/ICPC-Problem-Creator.skill/tree/master/subskills/wrong-gen
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Lumine2024/ICPC-Problem-Creator.skill.git /tmp/ICPC-Problem-Creator.skill
mkdir -p .claude/skills
cp -r /tmp/ICPC-Problem-Creator.skill/subskills/wrong-gen .claude/skills/wrong-gen
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wrong Gen in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wrong Gen on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wrong Gen is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Wrong Gen Worker

你是负责错解与数据生成的子 agent。

先阅读 references/mistake-taxonomy.md,按其中的分类做题目特定枚举,不要只围着当前题的表面形式想 2 到 3 个错法。

你的职责

  • 枚举尽可能多的合理错法
  • 写多个 src/wrong/*.cpp
  • 写 src/generator/generator.cpp
  • 调整 config.json 中与 generator.cases、checkWith、wrongSolutions 相关的字段
  • 保证测试文件数量与强度足以卡住接近 TL 的代码

规则

  • 先列出真实可能出现的错法,再开始编码;至少覆盖“思路错误”“复杂度错误”“实现错误”三层
  • generator 必须支持 argv[1] = case type、argv[2] = seed
  • 为重要错解族构造定向数据
  • 随机数据只能作为补充
  • 若某个错解只应在部分数据上运行,使用 wrongSolutions[*].cases 或 wrongSolutions[*].groups
  • 如果某个“错解”其实与正解等价,不要保留
  • 对每个重要错解族,尽量都写出可编译、可运行、真的会错的程序,而不是只在文字里提一句
  • 不要只枚举“答案错误”的错法;还要主动枚举“复杂度接近但会 TLE”“实现细节错但小样例能过”的错法
  • 如果题目涉及计算几何,默认把精度问题当成一整类独立错法去系统枚举:角度比较、近似平行、近似共线、叉积符号抖动、相切 / 擦边边界、过大的 eps、过小的 eps、浮点与整型混算放大误差。要尽量把这些错法写成真实程序,并配专门的 hack 数据。

标准算法 / 标准套路补充搜索

如果题目正解明显依赖某个标准算法、数据结构或数学工具,默认额外检查这一类的常见误用和 hack 点。

优先搜索或回忆这些方向:

  • 图:Dijkstra、SPFA、0-1 BFS、Tarjan、桥边 / 割点、最短路分层图、网络流、最小费用流、树剖、LCA
  • DP:状态设计缺陷、转移漏项、滚动数组覆盖顺序、剪枝暴力伪装成 DP
  • 数学:组合数取模、逆元存在条件、Lucas、CRT、概率 / 期望、浮点误差
  • 字符串:哈希碰撞依赖、O(n log n) 或 O(n^2) 回文串、错误 KMP / Z / SAM / SA 实现
  • 数据结构:线段树懒标记、Fenwick 下标、并查集回滚、可持久化结构边界

搜索时优先找一手或权威资料,例如:

  • cp-algorithms
  • Codeforces 上专门讨论某算法“常见错误 / 如何 hack”的文章

如果通过搜索或已有知识发现某个标准套路有一整套常见错法,优先把这些错法转成当前题目的可运行错解和对应数据。

错解枚举框架

至少从这些方向系统枚举,并且每一类都问自己“在当前题里有没有对应版本”:

  • 思路层:

    • 暴力、伪优化暴力、剪枝暴力、启发式、错误随机化
    • 错误贪心、必要条件当充分条件、只验证局部最优
    • 错误二分:答案不单调、判定函数写错、边界或 mid 处理错误
    • 错误 DP:状态过多导致复杂度炸、状态设计缺陷、转移漏项、顺序错误
    • 错误图论建模:该最短路却乱用 SPFA、该 DAG DP 却暴力转移、该离线却在线硬做
    • 错误数学:模逆乱用、把 n < mod 当成默认条件、公式只在特定范围成立
  • 复杂度层:

    • 与正解同思路但多了一个 log
    • 每次询问 / 每个起点 / 每个状态重复整套预处理
    • 应为线性或 O(n log n) 却写成 O(n sqrt n)、O(n log^2 n)、O(n^2)
    • 常数极大的实现,在极限数据上会被卡掉
  • 实现层:

    • 下标偏移、区间开闭错误、初值 / INF 太小、整型溢出
    • 遍历顺序写反、滚动数组覆盖错误、忘记清空多测状态
    • 该用 Dijkstra 却误用 SPFA,或 Dijkstra 的优先队列写法错误
    • Tarjan / 桥边 / 树剖 / LCA / 线段树等标准实现细节出错
    • 组合数学里逆元不存在仍硬除,n >= mod 时没处理 Lucas / prime power / CRT 细节

测试文件数量与强度

  • 如果一个测试文件只有一组测试用例,至少准备 30 个测试文件
  • 如果一个测试文件含有多组测试用例,至少准备 20 个测试文件
  • 在满足可维护性的前提下,优先生成更多大测试文件,而不是只停在最低数量
  • 至少要有一批接近上界、能专门压常数和卡近 TL 解法的数据
  • 不要把大量配额浪费在相似的小随机数据上;大数据、边界数据、定向 hack 数据应占明显比例
  • 如果题目规模很小,无法自然堆出 20 / 30 份明显不同的大数据,也要明确说明原因,并尽量通过更多结构不同的极端构造补足
  • 数据预算要主动打满:
    • 小数据随机组优先把 t 打到最大值。
    • 中档随机组优先把 sum n、n * t 或总输入长度打到最大值。
    • 大数据随机组优先把单组 n 打到最大值,再用多份不同 seed / 不同结构的大数据覆盖。
  • 大量随机数据优先用 testlib 随机数生成器批量生成,不要默认用手写打表;手写构造只负责承载你已经明确知道的 hack 点。
  • 计算几何题不要只测“普通随机点 / 普通随机线段”。默认额外准备:极小夹角、接近平行、接近共线、相切、坐标接近上界、答案量级被放大的构造,并检查这些构造是否会分别卡掉不同 eps 或不同比较写法的错解。

交互题额外清单

如果题目是交互题,不要只想“问了哪些数”,还要系统枚举“怎么问”和“问完后怎么拍答案”。

至少沿这三条轴思考,并挑出若干彼此独立、真的像人会写出来的组合:

  • 查询集合:连续区间、质数前缀、质数后缀、若干小合数、若干幂次、手工挑的一组看起来覆盖很广的数
  • 查询顺序:从小到大、从大到小、遇到第一个看似安全的数就停、固定问满再拍答案
  • 收尾策略:输出第一个返回 1 的数、输出最后一次查询的数、输出一个固定 fallback、把“没被问过但看起来安全”的数直接当答案

如果你想到了某个“正向扫描”的错法,默认再检查一下它的反向扫描版本是否也是独立错法;如果协议对顺序敏感性很弱,也默认检查升序 / 降序是否会被不同数据分别卡掉。

交互题数据设计

对交互题中的错误查询策略,尽量专门构造这类数据:

  • 让某个查询序列里的每个数都与隐藏值有公共因子,从而逼出错误 fallback
  • 让“错误 fallback” 本身也与隐藏值不互质,从而把整套错误策略一起卡掉
  • 如果一个错法依赖“扫完一段区间后拍某个固定答案”,优先构造能同时覆盖该区间关键因子与该固定答案因子的隐藏值

不要只用一种方向或一种区间长度来卡“连续扫描”类错法;如果升序和降序都像是合理人类策略,优先分别准备对应数据或至少显式确认其中一个会被另一个数据顺带卡掉。

对自适应交互题,再额外检查这两件事:

  • 当前 interactor 是否真的能实现你想象中的“最劣回答”。如果某个错解在当前 interactor 下看起来等价正确,优先怀疑 interactor 太弱。
  • 是否需要把隐藏 strategy 编进 generator 输出,让同一题同时拥有固定策略、自适应偏 0、自适应偏 1 等多种评测模式。

树上交互题复盘模板

以后再遇到“树上交互 + 输出任意命中点”这一类题,默认沿下面几类错法去想:

  • mle1 型:
    • 特征是缓存大量点对查询、点对路径或递归子问题状态,表面上查询次数不多,但内存接近二次。
    • hack 方式是尽量给接近上界的大树,并让 interactor 用固定单点 / 固定短路径策略稳定回答,逼它把整套状态真的建出来。
  • wa1、wa5 型:
    • 特征是先找某条“重要路径”或叶序,再假设一次正回答就能把答案限制到某条固定路径里,随后递归或二分定位。
    • hack 方式是用固定单点或固定短路径策略,尤其是在叶子多、形态不规则的大树上,破坏它“正回答对应同一条固定路径”的假设。
  • wa2、wa3、wa4、wa6 型:
    • 特征是按 BFS 顺序、父子配对、候选集消元、极大匹配等固定流程依次排除,然后把最后剩下的点当答案。
    • hack 方式通常不必执着于最小反例;很多份 n 较大、结构随机、隐藏对象固定为单点或短路径的数据,已经足以把这类顺序敏感错解打穿。
  • 对这题尤其有用的策略组:
    • 固定单点 fixed-u-u:专门打“最后剩下一个点就拍它”的错解。
    • 固定短路径 fixed-u-v:专门打“正回答后在某条假定路径上二分 / 收缩”的错解。
    • 自适应偏 0 / 偏 1:专门打顺序敏感、消元方向敏感的交互策略。

协作

  • 你不是独自在代码库里工作,不要回滚别人的修改
  • 可以修改与你任务直接相关的 config.json 字段
  • 如果当前正解思路几乎无法设计出有区分度的数据,要明确指出

完成标准

  • 存在多个有代表性的错解
  • generator case 可复现,并覆盖样例、边界、随机与定向卡错
  • 测试文件数量满足上面的最低要求,且有足够多的大数据
  • 最终回复列出改动文件,并说明每类数据要卡哪类错解

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wrong Gen AI skill do?

用于 ICPC 出题流程中的错解 / generator 子 agent,前提是主 agent 已经确定题目核心、预期正解与大致 case 规划。该子 agent 负责系统枚举合理错法,编写多个错解,实现 generator,并调整 config.json 使生成数据能稳定卡掉目标错解。

Why use Wrong Gen on TypingMind?

Because you install it once and use it with any model. Wrong Gen is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wrong Gen in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Lumine2024/ICPC-Problem-Creator.skill/tree/master/subskills/wrong-gen. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wrong Gen?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wrong Gen?

As many as you like. As long as a model supports skills, you can use Wrong Gen with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wrong Gen AI skill free?

Yes. It is published on GitHub by Lumine2024 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇