Skip to content
Finding Counterexamples (Draft)

Finding Counterexamples (Draft)

testcase.ac can automatically search for counterexamples for incorrect solutions.

How to use it

Check whether the problem is supported

You can find counterexamples only for problems where someone has contributed accepted solution code and generator code.

If the problem uses a special judge, checker code must also be provided.

You can check whether a problem is supported in one of these ways:

Submit your code and review the result

When you submit code, the generator can run for up to 45 seconds and create up to 100 test cases. testcase.ac compares your program’s output with the accepted solution’s output.

If individual test cases were added, either as direct input or generated by code, they always run before the general generator test cases.

When a counterexample is found, testcase.ac shows up to three examples for each category: wrong-answer counterexamples and execution-failure counterexamples. Counterexamples are sorted by size, starting from the smallest one.