Stress Tester for Competitive Programming.
This is very useful when you have a code that gives wrong answer and you don't know why.
Write a brute force solution and compare it against your code, it will show you the testcases where you failed.
- Place the correct (but slow) brute force solution in the file
brute_sol.cpp. - Place the optimal (but wrong) solution in the file
optimal_sol.cpp. - Go to
testcase_generator.pyand modify thegenerate_and_print_testcase()function. - In your terminal, run
./mapper.sh 20for example to run 20 testcases.
Imagine the following simple and silly problem:
Given some n, print n if n <= 20 and otherwise print -1.
If for example our wrong code always outputs n no matter what, this is what will happen:
However if everything is working correctly, it will always look like this: