Git Product home page Git Product logo

cptool's Introduction

CP Tool

CP Tool is a command line tool for competitive programming.

Usage

# generate problem in ./example/a_plus_b
./cptool -w ./example/a_plus_b

# export problem to online judge format
# currently only support syzoj
./cptool -w ./example/a_plus_b --export-oj=syzoj
# export to ./output/syzoj
./cptool -w ./example/a_plus_b -e=syzoj --export-dir=./output

# for more information
./cptool --help

problem.yaml is the problem description file.

name: a_plus_b # problem name
programs:
  gen: # program name
    info: !command
      path: ./gen # command path
      extra_args: [] # extra arguments, optional
    time_limit_secs: 1.0
    memory_limit_mb: 512.0
  std:
    info: !cpp
      path: ./std.cpp
      compile_args: [-O2, -std=c++14] # compile arguments, default to [-O2]
    time_limit_secs: 1.0
    memory_limit_mb: 512.0
  val:
    info: !cpp
      path: ./val.cpp
      compile_args: [-O2, -I../assets/testlib/]
    time_limit_secs: 1.0
    memory_limit_mb: 512.0
  chk:
    info: !cpp
      path: ../assets/testlib/checkers/lcmp.cpp
      compile_args: [-O2, -I../assets/testlib/]
    time_limit_secs: 1.0
    memory_limit_mb: 512.0
solution: std
validator: val # optional
checker: chk # optional
test:
  bundles: # data bundles
    sample: # bundle name
      cases:
      - generator: gen # program name
        args: [20] # arguments to program
    main:
      cases:
      - generator: gen
        args: [10]
      - generator: gen
        args: [10000000]
      - generator: gen
        args: [1000000000]
  tasks: # subtasks
  - name: sample
    score: 1.0
    type: min
    bundles: [sample] # bundle names
  - name: main
    score: 99.0
    type: sum
    bundles: [main]
    dependencies: [sample] # task names

Notes

  • Syzoj export is not fully supported yet.
  • Generator use multiple threads to generate data, so it may be slower than single thread generator.

cptool's People

Contributors

xjrjyy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.