Ocaml in competitive programming. Requires online judges with support for some common packages like Base or Core. Known judges that work are DMOJ and AtCoder.
bin/dune and bin/template.ml are the default build configuration and the default code
Other files in bin are the solutions to some problems, check the relavant commits for detail.
lib contains some commonly used code
The main problem is online judges only support a single file upload, and they do not support ppx, so I have to do that before submitting
- Use
oinit.fishto generate the files for<problem> - Write code
- Use
dune build <problem>.exeanddune exec <problem>.exeto build and run the code - Use
dune build <problem>_include.exeto generate the code that can be submitted directly, which I pipe towl-copyin order to submit
example.ml is an example of the processed result, it is a bit messy so any improvements are welcome.