Here is the description you get after typing cf-auto --help
usage: cf-auto.py [-h] {create,run} ...
Codeforces routine tasks automation tool.
positional arguments:
{create,run}
options:
-h, --help show this help message and exit
From this we can tell, that cf-auto is capable of:
- creating necessary files for the specified contest OR problem
- compiling and running your
C++code with further comparing with fetched test cases: Right here, right now.
Use cf-auto and solve problems in one directory
cf-auto create C 2000The resulting directory has the following structure:
2000
├── A
│ ├── 2000A.cpp
│ ├── ans.txt
│ ├── in.txt
│ └── out.txt
├── B
│ ├── 2000B.cpp
│ ├── ans.txt
│ ├── in.txt
│ └── out.txt
├── C
│ ├── 2000C.cpp
│ ├── ans.txt
│ ├── in.txt
│ └── out.txt
etc.
cf-auto create P 2000 AAnd you get:
practice/
└── 2000_A
├── 2000_A.cpp
├── ans.txt
├── in.txt
└── out.txt
Coming soon...
- Clone the repo
git clone https://github.com/Lassa30/cf-auto.git- Install dependencies
pip install -r requirements.txt- Run
cf-auto
python cf-auto.py --helpOptional:
- Add this alias to
~/.bashrcto runcf-autowithout interpreter namealias cf-auto="python3 cf-auto.py"
- Create a virtual environment before you install the dependencies
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
Note: the configuration is too simple and stupid, just hardcoded
TEMPLATE_PATH = "cf_template.cpp" # i.e. the path to your template file
BUILD_OPTIONS = "-Wall -g0 -O0 --std=c++20" # i.e. just some options for g++- Nicer logging
- Use and test by yourself
- Add example usage