CPLib is a library written in C++ for processing test data of competitive programming problems. It helps you write clear and efficient checkers, interactors, validators, and generators. CPLib uses "variable input template" as its major feature, provides friendly feedback for humans and backends, and is working hard to reach better compatibility and efficiency.
You can get CPLib from Github Repository. The "single-header-snapshot" branch automatically updates single-header version of CPLib which is easy to use. Also, you can visit cplib.vercel.app for more information. For regex-related questions, please relate to the FAQ page.
Here is a basic example of a checker using CPLib. For more examples, visit the links above.
#include "cplib.hpp"
using namespace cplib;
CPLIB_REGISTER_CHECKER(chk);
void checker_main() {
auto var_ans = var::i32("ans", -2000, 2000);
int ouf_output = chk.ouf.read(var_ans);
int ans_output = chk.ans.read(var_ans);
if (ouf_output != ans_output) {
chk.quit_wa(format("Expected %d, got %d", ans_output, ouf_output));
}
chk.quit_ac();
}
The project is mainly written by yzy1, and I, tiger2005, work on syntax designs and some tiny stuffs. The project is still under development, so feel free to make suggestions!