Guide to creating problems
This page explains how to think up, create and publish a new problem on JOEL. To do it you need the problem creator permission: ask the administrators for it (see About).
1. Before you start
Category
Think about which category your problem belongs in (they are explained in Categories):
- Primers Passos (First Steps): they can be solved without loops. Therefore, each test case has to be a separate file (see Individual cases below).
- Introduction: very simple, without data structures such as arrays. Ideally, with a guide (see point 5).
- Aprenentatge (Learning): a single concept; the difficulty lies more in implementing than in figuring out what to do. It can range from reversing a string to implementing Dijkstra. It would be the typical 2-3 point exercise in an exam.
- Competitiu (Competitive): contest problems: you need to interpret the statement, think of the solution, and they may combine several concepts.
- Extern (External): problems that aren't yours but from some real contest (with permission to publish them).
Don't use the other categories without talking to the administrators first.
Points
Deciding the points is one of the hardest parts. Look at problems of similar difficulty and give it an equivalent amount. Most problems are worth between 3 and 15 points; think it over carefully before giving more than 15.
Test cases
A problem should have about 15-20 fairly exhaustive test cases (edge cases included), of which 3-5 should be public (the ones in the statement). Group them into at least two pairs of input/output files: one for the public ones and one for roughly every 10 private cases. If a file has a lot of cases (more than 10,000), don't enable feedback, because it would bring down the judge and the teachers' screens.
Test case format
The judge replaces the program's standard input and output with files, runs it and compares what it writes with the expected output. That's why it can't tell on its own which input line corresponds to which output line. For the hints system to be able to tell the student which input fails, the problem must follow one of these formats:
Standard
One input line corresponds to one output line. So there are n output lines and n or n+1 input lines (the +1 is the first line stating how many cases there are). Example: compteambelveri.
Fixed ratio
n input lines correspond to m output lines, with n and m fixed and one of the two equal to 1 (2 to 1, 5 to 1, 1 to 4...). The first line with the number of cases is also taken into account. It doesn't work if both are more than one line (4 and 2 can't be told apart from 2 and 1). Tip: make the output always a single line, except in matrix exercises. Example: colarse (3 to 1).
The judge recognises these two formats by itself: choose Standard/fixed.
STOP at the end
Like standard or fixed ratio, but instead of a first line with the number of cases there's one at the end, with an agreed value, which signals the end of the input. Example: 7segments. You must choose STOP at the end.
Each case states its number of lines
"The first line states the number of cases n. Each case starts with a number k saying how many lines it has, followed by the k lines." The output of each case is always a single line. Examples: pozoluna, torniquet (there are 2 numbers on the line, but the one that counts for the hints is the first), buscamines. You must choose Lines given per case.
Individual cases
If it doesn't follow any of the formats above, each case must be a different input/output file. Examples: barrethogwarts (too introductory to have an input loop), blackfriday, consellescolar (the output has a variable number of lines). You must choose Individual cases.
Irregular case
If there is no way to make it fit, the hints system cannot be enabled: use a checker without feedback (usually Line by line (teachers only)).
2. Creating the problem
Go to the administration, log in with your user and press Add problem.

- Problem code: unique and short; it's what appears in the address (
/problem/<codi>). - Problem name: the title everyone will see.
- Creators: add yourself or you won't be able to edit the problem again.
- Problem image (optional): upload an illustration (JPEG, PNG, GIF or WebP, up to 12 MB) and it is shown on its own, to the right of the statement, the same in every language and in the PDF. There is no need to write an
<img>tag in the Problem body. It is shrunk automatically and displayed at most 300 px wide; you can only add one. - Problem body: the statement, in Markdown with LaTeX formulas between
~(for example~2^{31}~). The easiest thing is to copy the structure of an existing problem (statement, Input, Output, Sample input, Sample output) and change the text.
Further down:

- Problem types: as many as needed, at least one. Don't create new ones.
- Problem group: the category you chose in point 1.
- Points and Allows partial points (enabled, so students get partial marks).
- Time limit: no more than 5 seconds.
- Memory limit: be generous (the Java virtual machine needs it). 64 MB is enough for 99% of problems.
- Allowed languages: usually all of them.
Save it. The problem won't be public until a moderator reviews it.
3. Uploading the test cases
On the problem page (or from the administration), press Edit test data.

- Upload a zip file with the cases. Each case is two text files, one for input and one for output. By convention they end in
.inand.out(for exampleprob.1.in,prob.1.out,prob.2.in...), but it isn't mandatory. Save once so the judge reads their names. - Choose the Checker:
- Line-by-line (with feedback): enables the hints system and superhints. It's what almost every problem should have.
- Line by line (teachers only): teachers see the errors and the input, but students get no hints. For irregular formats.
- Standard: no feedback at all (or for files with more than 10,000 cases).
- Programame-like: like standard, but presentation errors (spaces, line breaks) count as WA.
- Compare against file: for file exercises, in which the answer is written to a file instead of standard output.
- MySQL checker / PostgreSQL checker / Mongo checker: for database problems. These are prepared by the administrators; if you want to make one, talk to them.
- Choose the Test case format according to point 1. If you choose the wrong format, the hints will give wrong information.
- Number of allowed tips (default 1; 0 if you don't want hints) and Allowed superhints (if you leave it empty, half the hints rounded up).
- Add a row (Add new case) for each pair of files, with its points. The final score is proportional: if the problem is worth 20 points and has 3 cases of 1, 2 and 7 points, whoever gets the first two right will get (1 + 2) / (1 + 2 + 7) × 20 = 6 points.
- Press Submit!.
4. Checking it
Submit a correct solution (it must get AC) and at least one wrong one, and check that the hint points to the right input. While the problem isn't public, only its creators and the administrators can see it.
5. Guides (introduction problems)
Introduction problems can have a guide (the graduation cap ): an explanation of how to approach them and of the usual pitfalls, without giving away the solution. It's done in the problem's administration, in the guide section: a general text and, if you want, translations per language and a code hint per programming language (Python, Java...).
6. Afterwards
You can edit the problem whenever you want and use the comments to clear up doubts. Statements can also be translated into other languages (Spanish, English...) from the administration.