{"id":22274929,"url":"https://github.com/johnathan79717/codeforces-parser","last_synced_at":"2025-07-28T16:30:57.188Z","repository":{"id":13242241,"uuid":"15927026","full_name":"johnathan79717/codeforces-parser","owner":"johnathan79717","description":"Parse sample tests of Codeforces competitions, and generate tests automatically.","archived":false,"fork":false,"pushed_at":"2022-03-31T15:18:31.000Z","size":50,"stargazers_count":133,"open_issues_count":2,"forks_count":47,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-06-21T18:12:44.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnathan79717.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-15T06:33:31.000Z","updated_at":"2024-01-19T10:20:30.000Z","dependencies_parsed_at":"2022-09-09T05:53:37.244Z","dependency_job_id":null,"html_url":"https://github.com/johnathan79717/codeforces-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnathan79717%2Fcodeforces-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnathan79717%2Fcodeforces-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnathan79717%2Fcodeforces-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnathan79717%2Fcodeforces-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnathan79717","download_url":"https://codeload.github.com/johnathan79717/codeforces-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227925671,"owners_count":17841515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T13:31:04.558Z","updated_at":"2024-12-03T13:31:06.501Z","avatar_url":"https://github.com/johnathan79717.png","language":"Python","readme":"Codeforces Parser v1.5.1\n=================\n\nSummary\n-------\n\n[Codeforces](http://codeforces.com/) is a website for _competitive programming_. It holds contests, so-called **Codeforces Rounds**, about every week.\n\nThis is a python program that parses the sample tests from the contest problem pages. For each problem, it generates the sample input/output files and a shell script to run sample tests.\n\nYou can also find this article here, [http://codeforces.com/blog/entry/10416](http://codeforces.com/blog/entry/10416)\n\n### Installation\n\n * Arch Linux (AUR): https://aur.archlinux.org/packages/codeforces-parser-git/ (note that parse.py is renamed codeforces-parser)\n\n### Example:\n`./parse.py contest_number (e.g. ./parse.py 513)`\n\nWhere `512` is the contest number, not the round number! Check the URL of the contest on your browser, that is the number you are supposed to use.\n\n### Effect:\n\n##### What will happen, for example, if `./parse.py 512` is executed?\n\n1. Directories `512/A`, `512/B`, `512/C`, `512/D` and so on are created depending on the contest number of problems.\n2. For each problem, `main.cc` is copied and renamed to the problem letter to the corresponding directory. **You can put the path of your usual template in `parse.py:20`**.\n3. Problem page is downloaded from Codeforces website, and parsed. Sample input/output files are generated, e.g. `input1`, `output1`, `input2`, `output2` and so on. You can create your own test cases after that, just keep the same naming format as others test cases.\n4. A script `test.sh` is generated. You can use it to compile and run the sample tests after you finish coding. Just run `./test.sh` in the problem directory.\n\n##### What will happen if `./test.sh` is executed?\n\n1. Compilation: `g++ -g -std=c++0x -Wall $DBG main.cc`. **You can change the compile options in `parse.py:21`**. Variable $DBG is set to -DDEBUG if you start \"./test.sh -d\", otherwise it is empty. This allows for compilation with and without debug macros.\n2. Run each sample tests on your program (`a.out`), and check the output by `diff`. If it's correct, print **Accepted**, or else print the sample test that went wrong.\n3. Please note that for problems with multiple correct answers it might say that your output is incorrect.\n\n### Collaborators and Versions:\n\n##### List of CodeForces Collaborators:\n+ [johnathan79717](http://codeforces.com/profile/johnathan79717)\n+ [brunoja](http://codeforces.com/profile/brunoja)\n+ [Matthias Kauer (mini addition)]\nIf you have any suggestions and/or bugs drop a message!\n\n##### Versions Changes:\n+ **1.5.1:**\nMinor bug fixes related to Python 2 vs Python 3.\nMakes the template file to use the proper language extension.\n+ **1.5:**\nAdded debug flag (-d) to enable DEBUG macro (read above for details).\nFixed problems parsing for problem names that are not called A, B, etc. Such as A1, A2..\n+ **1.4.1:**\nMinor fixes, such as typos, bugs and special characters handling.\n+ **1.4:**\nChanged how the parser gets the problems. During the competitions the page is slightly different.\nFixed some invalid character on input and output causing the script to crash.\nForcing a new line on the input/output if there is none.\nFixed some line number information in this README file.\n+ **1.3:**\nSome minor fixes and code organizing. Also fixed some typos.\nRemoved the _sample_ from default input and output files.\n+ **1.2:**\nFixed some typos and constants. \nFetching contest info, printing contest name and problem names. \nThe contest may now have more or less than 5 problems, it will auto detect.\nThe script will now generate the template with the problem letter.\nFixed test cases fetching. The script was stopping for escaped html characters, such as '\u0026lt'.\nFixed script to work with python 3.\n+ **1.1:**\nCleaner generation of the test script, now it auto detects the test cases, making you able to create your own cases.\nEcho color output, for accepted we get a green message, otherwise it is red.\nAdded the time measurement for running the test cases.\nFor the runtime error case, it now outputs the input case.\nCreated some constants, such as compile options. These user modifiable constants should be easily spotted at the first lines of the python script.\n+ **1.0:** Initial Version.\n\n##### Todo, Bugs \u0026 Troubleshootings:\n\n+ In OS X it is necessary to install the `gnu-time` to measure time.\n+ This parser currently works only on Unix OSes. If you want to add Windows/Other support let us know.\n","funding_links":[],"categories":["Tools"],"sub_categories":["Personal use"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnathan79717%2Fcodeforces-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnathan79717%2Fcodeforces-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnathan79717%2Fcodeforces-parser/lists"}