This page introduces some OJ tools.
cf-tool
cf-tool is a cross-platform (Windows, Linux, and macOS) command-line tool for Codeforces that supports many common operations.
The source code is hosted at xalanq/cf-tool.


Features
- Supports all programming languages on Codeforces.
- Supports Contests and Gym.
- Submits code.
- Dynamically refreshes the status after submission.
- Fetches problem samples.
- Compiles and tests samples locally.
- Fetches all code by a user.
- Generates code from a specified template (including timestamps, authors, and other information).
- Lists overall information about all problems in a contest.
- Opens problem pages, standings, submission pages, and so on in the default web browser.
- Colorful command line.
Download
Go to cf-tool/releases to download the latest version.
Later updates can be obtained directly with the upgrade command.
Usage
Place the downloaded executable cf (or cf.exe) in a suitable location (see the second item in the FAQ), then open a command line and use the cf config command to configure the username, password, and code template.
Usage Example
The following briefly simulates the process of a contest.
cf race 1136
The 1136 contest is about to begin! The 1136 can be obtained from the contest link; for example, the link for the contest in this example is https://codeforces.com/contest/1136.
If the contest has not started, the command counts down. Once the contest has started or the countdown has finished, the tool automatically opens all problem pages for the contest in the default browser and fetches the samples locally.
cd 1136/a
Enter the directory for problem A. This directory will now contain the problem's samples.
cf gen
Generate a piece of code from the default template; here, let it be a.cpp.
vim a.cpp
Write code with Vim (or use another editor or IDE).
cf test
Compile and test the samples.
cf submit
Submit the code.
cf list
View information about each problem in the current contest.
cf stand
Open the standings in a browser.
Frequently Asked Questions
-
I double-clicked the program, but nothing happened.
cf-tool is a command-line tool; you should run it in a terminal.
-
I cannot use the
cfcommand.You should place the
cfprogram in a path that has already been added to the system variable PATH (such as/usr/bin/on Linux).If you do not understand, search directly for "how to add a PATH".
-
How do I add a new test data set?
Create two additional test data files,
inK.txtandansK.txt(K is a string containing 0~9). -
How do I enable tab completion for commands in the terminal?
Use Infinidat/infi.docopt_completion.
Note that if a new version is released (especially one that adds a new command), you should run
docopt-completion cfagain.
Codeforces Visualizer
Official website: Codeforces Visualizer
The source code is hosted at sjsakib/cfviz .
This website has three features:
- Visualizes various pieces of information about a user with cool charts (such as the distribution of problem difficulties).
- Compares two users.
- Calculates a predicted Rating for a contest.
Competitive Companion
This tool is a browser extension for parsing test case data from web pages. It supports almost all major OJ platforms (such as Codeforces and AtCoder). After using this extension, you no longer need to copy any test case data manually.
The source code is hosted at jmerle/competitive-companion .
Usage:
- Install the extension on Google Chrome or Firefox. The tool sends the parsed test case data in JSON format to a specified port.
- Install any tool locally that can listen to and read data from a port; see the official example.
Demonstration:
The demonstration was completed using zqxyz73's bytetools.
ac-predictor
ac-predictor is a plugin that lets you know the change in a contest's rating before the AtCoder rating is updated.
This tool is a Tampermonkey script, so you first need to install Tampermonkey.
After that, go to greasyfork and click install.
After installation, the contest leaderboard will display the predicted rating change for each user.
This tool has a Chinese-language version by GoodCoder666; click here to install it.