A modular and robust application to create competitive programming templates.
- You must be using Linux since this program uses a syscall (
readlink) that is only available on Linux. WSL should work as well. - Run
maketo compile the program. It should produce a binary calledgen. - If you want to use
genfrom anywhere, add the directorycp_gento your path. Please make sure thatgenis in the root directory of this repo since it requires reading/writing library files to templates.
- Simply enter
gen $FILENAMEto generate a C++ file.$FILENAMEis required. - The header for generated files is unchangeable unless you modify
main.cpp(feel free to). - Everything after the
BEGIN USER CODEline in the generated file is outputted fromuser.cppin this repo. You can freely modify this file to your liking. Make sure it includes a main function! - Everything after the headers and before
BEGIN USER CODEis outputted from./lib/$DS.hppwhere you can specify which$DSs you want to be included.
gen X.cpp -dsuwill include the Disjoint Set Union data structure and generate a file calledX.cppin the current working directory.gen ..\above.cppwill generate a file calledabove.cppin the directory above the current working directory.gen A.cpp -segtree -numwill include everything from./lib/segtree.hppand./lib/num.hppintoA.cpp.gen my_program.cpp -numwill include everything from./lib/num.hppinmy_program.cpp.
- To run tests, run
make tests. - If you're interested in adding your own templates and tests, check out
./tests/README.md.