Codeforces CLI that makes writing contests more efficient.
Project description
Codeforces Toolbox
This tool is a CLI (Command Line Interface) that makes writing Codeforces contests more efficient.
Features
- Create files based on the specified template. These files will be named appropriately for the contest, for example 1000A, 1000B1, 1000B2, 1000C.
- Download sample test from Codeforces.
- Compile solution and test it.
- Submit solution
- Wait for the verdict
Supported languages: C++, C, Python, Java, Kotlin, Rust, C#, Go.
Settings configuration
cft config
Choose one of the following (type an integer):
1. change the template file
2. change username and password
3. change password
4. change language
5. set compile command
6. set run command
then you can just type an integer (1-6) and change your template file, username, password, language, run or compilation command.
See the FAQ at the bottom of this page.
Creating structure for a contest
cft race 1234
creates the following directory structure (provided that your programming language is C++):
1234/
1234A.cpp
1234B.cpp
1234C.cpp
1234D.cpp
1234E.cpp
1234F.cpp
1234G.cpp
files 1234X.cpp are created by copying the previously specified template file.
It is recommended that you then change the current working directory (cd 1234
) to operate more smoothly later.
Testing solution
cft test 1234A
compiles your solution, downloads (if not yet downloaded) example test and checks if it passes.
If your current working directory is some/path/1234
you can type just cft test A
.
Test will be downloaded only if directories /in
and /ans
are empty or do not exist. You can force download test from Codeforces by using -d
or --download
flag.
cft test 1234A -d
cft test 1234A --download
If your answer uses floating point numbers you can determine what error will be acceptable by using -p
or --precision
flag.
cft test 1495A -p 1e-9
cft test 1495A --precision 1e-9
Of course, you can combine both flags, e.g. cft test A -d -p 1e-9
.
Submitting solution
cft submit 1234A
submits solution and returns judgement verdict.
If your current working directory is some/path/1234
you can type just cft submit A
.
Installation
Please first install Python 3.7 or higher from python.org. During installation you should check the option 'Add Python to PATH'.
Then just copy and paste in your terminal this:
pip install codeforces-toolbox
If you want to update the package, you can do this by:
pip install --upgrade codeforces-toolbox
Contribution & bugs
If you want to contribute to the project, fork this repository and open a new PR. If you have any questions or suggestions, email me (you can find my email address at my profile page) or create an issue.
FAQ
My favorite language is not supported!
Well, that is not a question, nevertheless I encourage you to create an issue in the repository.
Compile command, run command – what is this?
Compile command is the command you would use to compile your solution. For example: in C++ it can be g++ -Wall
, in Java javac
, in Kotlin kotlinc-native
, in Rust rustc
, in C# csc
, in Go go build
. Note that Python does not have a corresponding compiler because it is an interpreted language.
Run command is the command you would use to run your solution. If you are using a language that compiles to machine code that your operating system can run, you don't need this command. Otherwise, if you are using Python this can be python
, python3
, py
, pypy
. In the case of Java, it is probably java
.
I assume that your compiler/interpreter is added to the PATH environment variable. If it is not, add it, or provide an absolute path, e.g. C:\Users\user\AppData\Local\Programs\Python\Python39\python.exe
instead of just python
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file codeforces-toolbox-1.4.0.tar.gz
.
File metadata
- Download URL: codeforces-toolbox-1.4.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e276bbb0a99afe2c7be6761cc46e1d8fe3e88670f44918135d9e5c93f443d57e |
|
MD5 | b55f94e08f85f5e9f28f559354a5d477 |
|
BLAKE2b-256 | d0ceb0e8991acade98bf9b8755fcdbe5fc0ef0af6a886586861d56540e651523 |