Skip to main content

Cheatsheet

  1. cpbooster comes with a short alias command called cpb to avoid writing the long command each time

  2. Automatically clone sample testcases files with corresponding source code files with template loaded into a desired directory

    • cpb clone waits for competitive companion plugin to send parsed data for each problem
  3. Create source files with corresponding template loaded

    • cpb create a.py creates single file with corresponding template loaded based on file extension
    • cpb create {a..n}.cpp creates multiple consecutive files from "a.cpp" to "n.cpp"
    • cpb create {a...n}.cpp same as previous command (Any amount of dots greater than 1 work)
    • cpb create {a-n}.cpp same as previous command (Single dash also works)
    • cpb create /some/path/a.cpp creates "a.cpp" in the specified path instead of current location
    • cpb create /some/path/{a-n}.cpp creates "a.cpp ... n.cpp" in the specified path instead of current location
  4. Test your code against sample testcases quickly

    • cpb test mycode.cpp test your program against all available test cases
    • cpb test mycode.cpp -t 1 test your program against the test case with the given id
    • cpb test /some/path/mycode.cpp test a program that is not located in your current location

    Supported results:

    • AC (Accepted)
    • WA (Wrong Answer) Shows differences between accepted output and your output beautifully
    • TLE (Time Limit Exceeded)
    • RTE (Runtime Error)
    • CE (Compilation Error)
  5. Run code with your own debugging flags easily

    • cpb test mycode.cpp -d to use keyboard as input
    • cpb test mycode.cpp -t 2 -d to use a test case file as input
    • cpb test /some/path/mycode.cpp -d debug a program that is not located in your current location
  6. Submit your code from the terminal really quickly.

    • cpb submit mycode.cpp submits your file to the corresponding judge.
  7. open a new terminal in the contest directory immediately after cloning it

    • List of supported terminals for this feature:
      • konsole
      • xterm
      • gnome-terminal
      • deepin-terminal
      • terminal (MacOS)
      • kitty
      • vscode
        • I recommend adding this setting to your vscode settings.json so that green doesn't look to bright: "workbench.colorCustomizations" : { "terminal.ansiGreen":"#5b8a3a" }