Egor's blog

By Egor, history, 4 days ago, In English

Hello!

I am introducing a new tool for competitive programming—submitter. It does just that, submits your solution to supported online judges and displays results, all from the comfort of your command line.

Prerequisites

You would need rust and docker

Installation

cargo install --git https://github.com/EgorKulikov/submitter

Usage

submitter <task url> <language> <path to solution>

Supported sites

At the moment the following is supported:

  • Codeforces (unless Cloudflare would want to click you on the box, I cannot fool it yet)
  • Codechef
  • Yandex Contest
  • AtCoder
  • Universal Cup
  • Luogu (no support for changing language, language of the last submit is used)
  • Vote: I like it
  • +171
  • Vote: I do not like it

»
4 days ago, # |
  Vote: I like it +46 Vote: I do not like it

Over-engineering at its finest

  • »
    »
    4 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If you know how to get around (non-checkbox) Cloudflare another way, I am all ears

    • »
      »
      »
      3 days ago, # ^ |
        Vote: I like it +36 Vote: I do not like it
      • »
        »
        »
        »
        3 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I am afraid it also does goes through some cloudflare checks, but thanks, it seems to has less load and hence not reverting to checkbox as frequently

        • »
          »
          »
          »
          »
          3 days ago, # ^ |
            Vote: I like it +6 Vote: I do not like it

          It seems that mirror.codeforces.com doesn't have Cloudflare enabled (ref).

          • »
            »
            »
            »
            »
            »
            3 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Maybe, but they do some kind of browser checking anyway. Namely, I am getting a page where the body starts with

            <p>Please wait. Your browser is being checked. It may take a few seconds...</p>
            
            • »
              »
              »
              »
              »
              »
              »
              3 days ago, # ^ |
                Vote: I like it +12 Vote: I do not like it
              • »
                »
                »
                »
                »
                »
                »
                »
                3 days ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                Well, that's nice, but not something I want to spend my time on

»
3 days ago, # |
  Vote: I like it +28 Vote: I do not like it

Is it really more convenient to paste url to terminal than to submit via website?

  • »
    »
    3 days ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    It is if you use other tools in tandem

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Or bat file, which takes problem id as input and generates corresponding url. I did that with oj when I used that for atcoder submits while I still used c++

»
3 days ago, # |
  Vote: I like it +43 Vote: I do not like it

By the way, I forgot to write why I wanted such a tool. I usually use 2 screens for competitive programming, one for browser and one for ide. I do not want to shuffle browsers, so I can keep an eye on the results of the submit while reading the next problem, so I much prefer for the result of the submit to be shown in terminal, which is part of my ide layout.

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

cool

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

why would i use the tool over submitting myself?

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I already covered my own motivation for using such tool here

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

That's really cool, especially the fact that you did this for all these different websites. Thank you so much!!

»
3 days ago, # |
  Vote: I like it +19 Vote: I do not like it

Whoever uses it, be careful: it is much easier to accidentally submit something you didn't want to with this thing than without (for example, by pressing <Up> <Up> <Up> <Up> <Up> <Return> in the terminal with an incorrect number of <Up>s)

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

will it work during the live contest??

»
3 days ago, # |
Rev. 23   Vote: I like it 0 Vote: I do not like it

Suggestion to use this easier(works for codeforces idk about others).

we know that the link to a problem in Codeforces is always(most of the times)https://codeforces.me/contest/<contest ID>/problem/<problem ID>

we can use bash/shell scripting to automate the generation of links and get writing language to execute submitter <task url> <language> <path to solution>

You can just need to run the below command in the terminal to declare it or add in the .bashrc file to make it permanent

bash script

But to use what I tried, we need to maintain the directory structure as

directory_structure

now to run new command we just need to do msubmitter <problemID> <file name>

Example msubmitter A A.cpp (assuming we are executing this in the same directory as the solution file is in and the solution file is in the directory with name as <contestID>)

what the above bash script does is it gets the current working directory name and problem ID you entered, and creates the link ashttps://codeforces.me/contest/2039/problem/A, gets the extension of your file and then executes the command submitter <task URL> <language> <path to solution>

once we run msubmitter A A.cpp,
submitter https://codeforces.me/contest/2039/problem/A c++ A.cpp will get executed

Note: u first need to install the "submitter" by following his instructions

executing command output
  • »
    »
    3 days ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    [deleted]

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    script didnt work from the script you wrote these, so i downvoted, sry. <(_ _)>

    ideone is working fine.

    Thanks

»
37 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Support for toph.co is added