Code Monkey home page Code Monkey logo

cf_submit's Introduction

cf-code-submit

Submit code to codeforces from the command line, and other stuff (display solves for each problem, display standings).

In order to save the huge number of seconds needed to reach for the mouse during codeforces contests, I needed to be able to submit from the command line. There are many tools to do this for codeforces contests but I was unable to find an existing tool that allowed submissions to the codeforces gym for virtual contests, so I made this.

After being able to submit from the command line, I noticed that I was wasting too much time staring at the standings on codeforces. Now I waste less time (hopefully) by staring at the standings in the terminal.

Then I realized I would rather not navigate codeforces in my browser because looking for my mouse is a hassle, so now I can look at the number of solves for each problem in the terminal as well.

Warning

The handle and password are stored locally.

Setup (Linux)

  1. Clone the repository. git clone https://github.com/ehnryx/cf_submit.git
  2. cd into the cloned repository. cd cf_submit
  3. Move cf.py to cf for easy typing. mv cf.py cf
  4. Make the python script executable. chmod +x cf
  5. Edit .bashrc and add cf_submit to the PATH.

Uses

Submissions

  • con or gym to set default contest or gym ID. Example: cf con 844 or cf gym 101482
  • ext to set default file extension. Will be used when no file extension is given. (cf submit a)
  • submit to submit code. Will try to guess problem. Batch submit allowed. Example: cf submit or cf submit a.cpp
  • --prob or -p to specify problem. Example: cf submit code.cpp -p 844a
  • --watch or -w to Watch the status of submission after submitting it. Example: cf submit a.cpp -p 844a -w
  • peek to look at status of the last submission. Example: cf peek
  • watch to watch the status of the last submission if -w was not used. Example: cf watch
  • login to store login info (username and password), will prompt you to enter password. Example: cf login or cf login <your handle>
  • info to show stored handle and contest id. Example: cf info
  • time to show time left in contest

Examples: cf submit code.cpp -p844a -w

Print Standings

  • standings or st to look at friends' standings. Example: cf standings
  • --contest or -c to specify the ID of the contest to look at. Example: cf standings -c 844
  • --verbose or -v to print standings with more info. Example: cf standings -v
  • --top or -t to look top contestants. Defaults to top 50 if -t is not included, top 10 if --top is included but no number is given. Example: cf standings -t 20
  • --all or -a to look at all contestants instead of only friends. Example: cf standings --all
  • --sort or -s to merge the solves of different rows belonging to the same handle. Will not merge two correct submissions on different rows. Example: cf standings -s

Examples: cf st -v -t7 or cf standings -c844 -v -a

Print Problem Stats

  • problems or pb to look at the number of solves for each unsolved problem in a contest. Example: cf problems
  • --contest or -c to specify the ID of the contest. Example: cf problems -c 844
  • --verbose or -v to show solved problems as well. Example: cf problems -v
  • --sort or -s to sort problems by: number of solves, or index (id). Default sort is by number of solves (you do not need to use --sort). Example: cf problems -s id

Exmaples: cf pb -v -s id or cf problems -c100187 -v

Testing (Linux)

  • test to test code on input files. Suppose we want to test problem a. Then cf test a will do the job. This will call ./a < a*.in > a*.out for each file named in the form a*.in. Then it will compare a*.out with a*.ans ignoring differences in white space.

Dependencies

robobrowser https://pypi.python.org/pypi/robobrowser
prettytable https://pypi.python.org/pypi/PrettyTable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.