Блог пользователя PuiPuiTuiPui

Автор PuiPuiTuiPui, история, 3 года назад, По-английски

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.

cp-bot <contest-url>
cp-bot check

cp-bot contest-url

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.cpp is the main file containing the solution containing your template.
  • i[0..].txt are the files with the input for various test cases.
  • o[0..].txt will contain the output of running the respective i files with your program.
  • e[0..].txt is the expected output for the respective i file.

cp-bot check

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 PATH.

Miscellaneous

This was a hobby project written as I learn Golang. It's available on github so feel free to send in your pull requests and file your issues. And if you like the project give me a star!

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится