If you are using C++ to create an algorithmic competition problem, Testlib is an excellent auxiliary tool for writing related programs (generator, validator, checker, interactor). It is an essential tool for problem setters in Russia and some other countries, and many competitions also use it: ROI, ICPC regional contests, all Codeforces ro...
The Testlib library consists of only one file, testlib.h; when using it, you only need to add #include "testlib.h" at the beginning of the program you write.
The specific uses of Testlib are:
- Write a Generator, that is, a data generator.
- Write a Validator, that is, a data validator, to determine whether generated data meets the problem requirements, such as data ranges and formats.
- Write an Interactor, that is, an interactor for interactive problems.
- Write a Checker, that is, a Special Judge.
Testlib is fully compatible with Polygon, the problem-setting platform developed by Codeforces.
testlib.h was ported from testlib.pas in 2005 and has been continuously updated ever since. Testlib is compatible with most compilers, such as VC++ and GCC g++, and is compatible with C++11.
This article is mainly translated from Testlib - Codeforces. The GitHub repository of testlib.h is MikeMirzayanov/testlib.