A Codeforces parser for a specific contest identified by contest-id. Can be used for uninterrupted and smooth participation in a virtual contest, upsolving a practice contest or even a live contest.
Inspiration
Python is the "most powerful language you can still read".
- You are prompted the contest-id of the Codeforces contest you want to upsolve
- You enter the contest-id
- You are prompted for the preferred coding language from a list of options
- You enter the option no.
- The script starts scraping the desired contest
- A Folder is created having the format ( name-of-the-contest)
- Each folder has individual folders for each problem (A to F)
- Each such sub-folder has 3 files (Assuming the problem is A)
- A.cpp (Assuming you code in cpp)
- A.txt (The i/o file)
- input.txt
- Each such sub-folder has 3 files (Assuming the problem is A)
- A stats.txt and a stats.png file is also created having showing the problem vs accepted ratio.It helps the user gauge the difficulty of each problem and the contest as a whole.
- Each folder has individual folders for each problem (A to F)
- Star the repo and clone it.
- Download all the files in a zip
- Install latest version of python (add to PATH) if not already installed
- Pip install all the below mentioned modules and dependencies
Edit: Make sure python3 is installed. pip3 will be more favourable after reports from various users.
- Place the script in a folder where you want the folder of the contest
- Place your code template inside the template.txt file
- Run python3 vir.py or python vir.py as suitable
- Bonus - If you place it in a git initialised repository, after the script finishes, you can simply commit all the changes and all your contest-codes will be pushed to github
- An active internet connection while the script parses
int main() {
// your code goes here
freopen("input.txt", "r" , stdin);
return 0;
}
You need to change all the https to http and delete the argument verify = True from every get request.
The highlighted parts show the https and verify=True clauses. They need to be dealt with as described above the pic.
-
Modules
- os
- sys
- requests
- re
- bs4 (BeautifulSoup)
- time
- matplotlib
-
User Requiremets
- codeforces-contest-id of any contest
-
Python Version
- 3 or above
-
Active internet when py - script runs
-
The terminal (required for input) shows log as the script runs