Sukeesh's blog

By Sukeesh, history, 9 years ago, In English

GoCF

Contest parser for codeforces (only C++)

Github link : https://github.com/sukeesh/GoCF

Requirements

Tested on Linux Ubuntu 14.04, Elementary OS Freya.

Installation

  • Run ./install.sh

Usage

  • After the contest begins, fire up your terminal and type incf
  • Now, enter the contest code
  • GoCF will now download the test cases for you!
  • Now, for example let us take contest code as 624, name your problems as 624_A.cpp, 624_B.cpp, . .(Case sensitive)
  • Code in your favourite editor.
  • now, for testing your solution just gocf 624_A.cpp.
  • If you want to add a custom test case, adcf and enter problem code.

Asciinema

asciicast

EDIT

Added 'add Custom test case' feature and install script.

© [ Sukeesh ]

  • Vote: I like it
  • +70
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +15 Vote: I do not like it

Thanks for your efforts!

Would be terrific to add support for Windows users as well ;)

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

/bin/gocf: line 15: GoCF/sukeesh.txt: No such file or directory this is an error coming when i am doing this gocf 625_A.cpp.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    did you create a directory named 'GoCF' in your home folder?
    and do touch ~/GoCF/sukeesh.txt .

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I have the same issue. And yes, I have such file and folder. Maybe permission problem?

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      open terminal sudo vim /bin/gocf, change the line 5
      replace ~/GoCF/sukeesh.txt with /home/<username>/GoCF/sukeesh.txt

      and in line 21 to pathe='/home/<username>/GoCF/'
      It should work fine now!

      • »
        »
        »
        »
        9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        nothing happens after gocf a.cpp. I'm not strong in python, but it seems that it not enteres even to "while $todo -lt $tot " — loop

        • »
          »
          »
          »
          »
          9 years ago, # ^ |
            Vote: I like it +1 Vote: I do not like it

          first incf, enter the contest code ( Contest code is different from round number )
          . for example, take 8VC Venture Cup Quals.,
          Contest code is 626, let's say you want to test it for problem A, Your Problem name should be in the format 626_A.cpp [Strict]. Now, gocf 626_A.cpp

          • »
            »
            »
            »
            »
            »
            9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            thanks, it works, problem was that name of cpp file was in wrong format

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think the program is not parsing the complete set. It's parsing only first 5 problems (A — E). Example : http://mirror.codeforces.com/contest/626

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes,
    We need to change it here
    Almost all the contests have A-E , except for some openCup rounds
    I will add that feature as soon as possible.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Done, Now works fine for all the contests!

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I got this error after run incf.

Traceback (most recent call last):
  File "/home/arpa/GoCF/Parse.py", line 8, in <module>
    from colorama import init
ImportError: No module named colorama
  • »
    »
    9 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I have installed it.(with installing colorama)

    thanks for this!

    I will never get wrong answer on sample tests from today.

    but still I think you have to work on it.

    for example in gocf, you compile the code for every test, but it is enough to compile only for first test.And one other important notice: gocf compiles code with c++98, no c++11 :-)

    P.S. please add the feature that if compile fails, stop the process.(do not run pretests.)

    Sorry for my bad english!

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Sukeesh (previous revision, new revision, compare).

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Sukeesh (previous revision, new revision, compare).

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I improved the project (now supporting problems like A1, A2, ...) and also fixed conflicts with python3. Let's talk and update the project.