Skip to main content

A command-line tool to generate Online-Judge problem.

Project description

Generator-OJ-Problem

Downloads

A command-line tool to generate Online-Judge problem.

  • Render problem descriptions in Markdown to HTML
  • Check problem descriptions and data, including missing fields, UTF-8 encoding, end-of-line CRLF/LF
  • Packing problem data in freeproblemset(hustoj) format
  • Mechanism for generating input and output test data
  • Easy to define adapters for other online-judge platform

Have fun! If you have any suggestions or find any bugs, please tell me.

Install

pip install generator-oj-problem

# or use pipx for a standalone python environment
pip install pipx
pipx ensurepath
pipx install generator-oj-problem

gop --help

Usage

# Initialize your problem
gop init

# Modify the files to write problem
ls .

# Generate 2 sample data from id 1
gop gen -s 1 -c 2 --sample
# Generate 5 test data from id 2
gop gen -s 2 -c 5

# Trim sample and test data
gop trim

# Check validaty
gop check

# Pack your problem in FreeProblemSet format
gop -a fps pack

If you meet some encoding errors, ensure your Python interpreter runs in UTF-8 mode, e.g. adding PYTHONUTF8=1 to your environment variables.

Directory Structure

Here is a demo problem A + B Problem. Details about problem.yml and generator.py are given at the comments of the demo files.

The file with extension .md means it supports plain CommonMark by built-in render. Attention: No LaTeX and embeded image supports.

  • problem.yml Problem metadata and configuration
  • description.md Description
  • input.md Description of input
  • output.md Description of output
  • hint.md Hint
  • solution.txt Solution source code
  • generator.py Generator for input or output data.
  • samples/ Sample data
    • samples/0.in Input of sample
    • samples/0.out Output of sample
  • tests/ Test data (same form to samples/)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generator-oj-problem-0.0.2.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

generator_oj_problem-0.0.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file generator-oj-problem-0.0.2.tar.gz.

File metadata

  • Download URL: generator-oj-problem-0.0.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for generator-oj-problem-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a5aba25d30108a77a5015e8c4f8c42b1b8c2940b2766fd906c3a7d1a6409422e
MD5 e6e00848f180f21901dd2afd016811ad
BLAKE2b-256 6e2890cd810ec84deaf36ea9fe04a7634b426850a5c5eee39f5d34256cfc1347

See more details on using hashes here.

File details

Details for the file generator_oj_problem-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for generator_oj_problem-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ea76b066fecd9657b9ce8352db2cc63f76bc1b563cb2eba9551918adebca3c2
MD5 36686731a3f8de1a2002d610f73b77bf
BLAKE2b-256 331e70ddbe44b41a1c493c78e215a20b5153a70c89d039377542f7e153a6ddab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page