Skip to content

Commands

NotTete edited this page Jul 30, 2024 · 14 revisions

cjudge-create

Its creates problem given a judge and a problem.

Basic usage

cjudge-create judge problem

This will create a problem folder which consists of:

problem
├── main.cpp
├── problem.pdf
├── .meta
└── samples
    ├── 1.in
    └── 1.out

List of available judges:

Note

It is possible to provide no judge. In this case the problem created will have empty test samples, no statement and you won't be able to submit to any judge.

cjudge-create problem

Warning

If you want to download Kattis problem statement you might find some problem if you don't have installed latexmk installed. Because kattis problem statements aren't directly downloaded, instead they are created using LaTeX with my package kattispdf. Learn more

Extra parameters

-p PATH, --path PATH: By default the problem will be created as a folder in the current directory. If a PATH is provided it will be created inside the given path.

-f, --force: By default the problem won't be created if the folder already exists. If --force this behaviour is overriden.

--nostatement: By the default the a problem statement is created. If '--nostatement' this behaviour is overriden.

--nosample: By the default the a problem samples are downloaded. If '--nosample' empty sample test will be created.

cjudge-info

Its displays online information of a problem.

Basic usage

cjudge-info judge problem

or

cjudge-info problem-folder

Example

cjudge-info-example.png

Note

In the case of problems without a judge, little to no information will be displayed.

cjudge-submit

Submits a problem to the corresponding judge.

Basic usage

cjudge-submit problem-folder

Important

User and password of the judge will be necessary every time you try to submit a problem.

Warning

When using kattis you will need to introduce your token and username into the config file. Learn more

Extra parameters

-n, --notest: By default the problem is tested before being submitted. If --notest this behaviour is overriden.

cjudge-test

Test a problem

cjudge-test problem-folder

Custom test cases

In order to write custom test cases you must save the input and output in the samples folder. The name of the files must be the same, for example: testname.in and testname.out

You can also create tests with only input for example: testname.in. This tests will run but you won't get any veredict just your program output.

Extra parameters

-i, --interactive: Test your problem with an interactive sample

-nf, --nofile: By default cjudge-test create files ending at .res with the output of your program in the samples folder. --nofile overrides this behaviour

-o, --output: It changes the displayed information when running test. Avilable options: quiet, error and full. The default mode can be changed on config file

  • full output

cjudge-test-full.png

  • error output

cjudge-test-error.png

  • minimal output

cjudge-test-minimal.png