I do CP as a hobby and it’s been fun for the most part. However, one thing that annoys me is the constant
Ctrl+c Ctrl+Shift+v I have to do when testing my solution. So I created the tool cp-bot.
What it provides
Currently, it provides two commands which work for Codeforces and Atcoder contests. (Codechef doesn’t have static pages so I couldn’t use the same strategy I used for the other two )
cp-bot <contest-url> cp-bot check
This command creates the following structure in ~/cp/ directory by scraping the contest pages. It will also copy ~/cp/template.cpp to this directory so you can get started coding right away.
<contest-id> ├── <problem-id> │ ├── exp[0..].txt │ ├── inp[0..].txt │ ├── out[0..].txt │ └── sol.cpp └─...
sol.cppis the main file containing the solution containing your template.
i[0..].txtare the files with the input for various test cases.
o[0..].txtwill contain the output of running the respective i files with your program.
e[0..].txtis the expected output for the respective i file.
Once done with your solution run this command in that problem directory to check your solution against all corresponding expected outputs and get a nice diff view.
How to install
For now, it only works for UNIX systems. Go here and download the
cp-bot binary and place it in
~/.local/bin/ or any directory on your