Skip to content

gupta-paras/codeforces-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimalist Codeforces Parser

What is it?

A lightweight, easy to customize contest parser and pretests runner


What's the need?

During programming contest of stringent time limits, even few seconds matter. It is time consuming to copy past test cases and execute the code on local again and again.

Using this tool in a 2-word command (parse_contest X) it will download and create a folder structure with all the pretests (Sample Testcases) for that programming contest.

Also using a 2-word (test Y) command it will execute all pretests for any problem.

In other words it will remove all manual effort in copy pasting inputs and comparing outputs for all pretests (Sample Testcases).


How to use?

Step-1: Navigate to the project folder.

Step-2: run command: [sample command : parse_contest 1427 ] :
It will create directory structure like below: (with cpp files generated using template in ref folder)

└───1427
   │    A.cpp
   │    B.cpp
   └───pretests
       ├───A
       │       input_0.txt
       │       output_0.txt
       │
       └───B
              input_0.txt
              input_1.txt
              input_2.txt
              input_3.txt
              output_0.txt
              output_1.txt
              output_2.txt
              output_3.txt

Step-3: Running testcases: [sample command : test B ]

> test B
------------------------------
pretest - 0: PASSED
6
ac?b?c
24
24
------------------------------
pretest - 1: PASSED
7
???????
2835
2835
------------------------------
pretest - 2: PASSED
9
cccbbbaaa
0
0
------------------------------
pretest - 3: Failed
4
????
12
13

Color scheme

Entity Color
Pretest Status Green if success else Red
Pretest Input Yellow
Expected Output White
Programs Output Green if success else Red

Contents

parse_contest.bat:

  • Calls parse_contest.py and change directory to current folder

parse_contest.py:

  • Fetch contest details from contest page and get all problems list
  • fetchs pretests by starting new thread for each problem page
  • generates apropriate directory tree

ref/ref.cpp:

  • Template cpp file

ref/run.bat:

  • Compile and Run Cpp
  • Compile only if executable is modified before the code

ref/test.bat:

  • calls test_script.py with problem

ref/test_script.py:

  • script to execute all pretests one by one for given problem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published