Problem authoring guide

Steps

Fill in the five steps of a new problem in Studio, then submit it for review. It becomes public after an administrator approves it.

  1. Problem: title and statement
  2. Limits: time, memory and output limits
  3. Examples: input and output shown to solvers
  4. Judging: answer checker and hidden judging tests
  5. Information: source, statement language, difficulty and tags

Parts of a problem

PartRule
TitleUp to 200 characters
StatementMarkdown. Describe the task, then ### Input and ### Output. Write math as $...$ or $$...$$.
Examples1–10. Shown to solvers.
Judging tests1–20. Hidden from solvers.

Limits

Set time limits so the intended solution passes and a slow one does not.

LimitRangeDefault
CPU time1 ms–10,000 ms1,000 ms
Wall timeCPU time or more, up to 30,000 ms3,000 ms
Memory1,024 KB–524,288 KB131,072 KB
OutputUp to 8,192 KB64 KB

Answer checking

  • Compare whitespace-separated tokens (tokens): ignores differences in spaces and line breaks.
  • Exact match (exact): spaces and line breaks must match too.

Problems with several correct answers or a floating-point tolerance are not supported.

Good judging tests

For a greatest common divisor problem, include:

  • The smallest input and equal numbers: 1 1, 7 7
  • Multiples and coprime numbers: 12 36, 17 5
  • The larger number second: 18 12
  • The largest values allowed, so trying every divisor exceeds the time limit

Compute expected outputs with a correct solution.

Source and copyright

Mark a problem you wrote yourself as an original source. You keep its copyright and permit service use under the terms. Do not copy problems from other sites. For a problem based on outside material, choose the original source and its license.

Import as JSON

Paste the JSON into Import on a new problem in Studio, or upload a .json file. You can also drop the file anywhere in Studio.

FieldRule
format"codykata.problem-draft"
version1
language"ko" or "en". Omit to keep the current language.
tagsUp to 10 tag names. A name that is not an existing tag becomes a candidate tag.
problem.schema_version2
problem.titleUp to 200 characters
problem.content[{ "id": "statement", "type": "text", "text": "…" }]
problem.samplesUp to 10 { "input", "output" }
problem.limitscpu_time_ms, wall_time_ms in ms; memory_bytes, output_bytes in bytes
problem.checker{ "type": "tokens", "version": 1 } or "exact"
problem.testsUp to 20 { "id", "input", "answer" }
  • End each input and output line with \n.
  • A content id starts with a lowercase letter and uses a-z0-9-. A test id uses A-Za-z0-9_-.
  • Source, difficulty and images are not imported.

Example

json
{
  "format": "codykata.problem-draft",
  "version": 1,
  "language": "en",
  "tags": [
    "math",
    "number theory"
  ],
  "problem": {
    "schema_version": 2,
    "title": "Greatest common divisor",
    "content": [
      {
        "id": "statement",
        "type": "text",
        "text": "Find the greatest common divisor of two positive integers $A$ and $B$.\n\n### Input\n\nThe first line contains $A$ and $B$ separated by a single space. ($1 \\le A, B \\le 10^{18}$)\n\n### Output\n\nPrint the greatest common divisor of $A$ and $B$."
      }
    ],
    "samples": [
      {
        "input": "12 18\n",
        "output": "6\n"
      },
      {
        "input": "17 5\n",
        "output": "1\n"
      }
    ],
    "limits": {
      "cpu_time_ms": 1000,
      "wall_time_ms": 3000,
      "memory_bytes": 134217728,
      "output_bytes": 65536
    },
    "checker": {
      "type": "tokens",
      "version": 1
    },
    "tests": [
      {
        "id": "t1",
        "input": "1 1\n",
        "answer": "1\n"
      },
      {
        "id": "t2",
        "input": "18 12\n",
        "answer": "6\n"
      },
      {
        "id": "t3",
        "input": "12 36\n",
        "answer": "12\n"
      },
      {
        "id": "t4",
        "input": "1000000000000000000 1\n",
        "answer": "1\n"
      }
    ]
  }
}

Make a problem with an AI tool

Send this to an AI tool that can read web pages to get the JSON above and a correct solution.

text
Read https://codykata.com/en/authoring.md and write one Euclidean algorithm problem in that format.

Check the expected outputs with the solution before importing.