dannyboy20031204's blog

By dannyboy20031204, 9 months ago, In English

CounterGen: Auto Counter-Example Generator for Debugging

Tired of getting "Wrong Answer" on gym problems with no clue why? Or being handed a giant unreadable testcase that doesn’t help at all?

Introducing CounterGen — an LLM-assisted tool that automatically generates minimal, human-readable counter-examples for your buggy programs.

  • Uses LLM APIs (Gemini, Claude, or OpenAI)

  • Each generated code is automatically tested to ensure it functions correctly before being used.

  • Once verified, these codes are combined into a stress-testing pipeline that runs your buggy solution against many testcases.

  • Produces minimal failing testcases automatically.

 Demo Video

Workflow at a glance:

Try It Out!

The full source code is available in Github.

CounterGen Github Repo

Just follow the instructions in the README to get started!

Important Notes

  1. Beta disclaimer: CounterGen is still in development. Sometimes the counter-examples may not be successfully generated (especially in harder problems). We’re actively improving it, and your feedback would be valuable.

  2. Contest rules: Please DO NOT use CounterGen during official contests. As per this Codeforces blog post , using AI assistance during contests may violate the rules. CounterGen is meant for practice, learning, and debugging outside of contests.

Any feedback or suggestions are very welcome!

Full text and comments »

  • Vote: I like it
  • +102
  • Vote: I do not like it

By dannyboy20031204, history, 4 years ago, In English

1635A - Min Or Sum

Tutorial
Solution

1635B - Avoid Local Maximums

Tutorial
Solution

1635C - Differential Sorting

Tutorial
Solution

1635D - Infinite Set

Tutorial
Solution

1635E - Cars

Tutorial
Solution

1635F - Closest Pair

Tutorial
Solution

Full text and comments »

  • Vote: I like it
  • +257
  • Vote: I do not like it