Quick Introduction to the Kattis Problem Format

This document is a quick introduction to writing problems for the Kattis Problem Format and using Kattis Problem Tools. For more thorough documentation about the Kattis Problem Format, please refer to [Problem_Format]. For more information about the Kattis Problem Tools, please refer to https://github.com/Kattis/problemtools

Example Problems

To start with, it probably helps to see some examples. Here's a set of problems that are written in the format: http://ncpc.idi.ntnu.no/ncpc2015/ncpc2015all.tar.bz2 (Warning: 22+ MB download.) These were the ones used for NCPC 2015. You can see how they appear on Kattis in HTML here: https://ncpc15.kattis.com/problems

Kattis Problem Tools

Here is the source to the Kattis problemtools: https://github.com/Kattis/problemtools You can install these on Ubuntu (see the README on that page). The three key programs you need from this are verifyproblem, problem2pdf, and problem2html.

verifyproblem

Verifyproblem will do something like the following:

Kattis Problem Format

Here's extensive documentation on the problem format: [Problem_Format] Note that some sections are deprecated and some are not yet implemented (but are marked as such).

Typical Problem Format Layout

The problem format is a directory with a top-level file problem.yaml and a number of subdirectories (and sub-subdirectories). Here are some of the common things that are expected:

Test Data

NB: Kattis runs all sample AND secret test cases with each submission, so no need to include an extra copy of the samples in the secret directory

NB: the order of tests is the file sort order of the file names (all samples before all secrets)

Validators

Problem Statement

Submissions (Correct **and** Incorrect)

problem.yaml

Using the Problem Format on Kattis Judge

When judging on Kattis, Kattis's default output validator is lenient on whitespace changing differences, but this can be made strict. Also, floating-point outputs can be judged to be correct within some specified tolerance (relative or absolute), which is really nice.