What it is

A contest is a set of algorithmic problems with tests, as on Yandex.Contest or Codeforces. Every problem has a statement, examples, and time and memory limits. An entrant writes a solution in Python, C or C++ right on the problem's page (or drops a file), presses SEND, and within seconds sees a verdict: OK, WA, TL, ML, RE, OL or CE, with the number of the first test that failed.

Contests live under Contests in the admin panel, next to competitions. A competition scores one notebook with a metric; a contest runs many small programs against many tests. The entrant is shared: the same entry key, the same /k list.

VerdictMeaning
OK — AcceptedEvery test passed.
WA — Wrong answerThe output did not match the answer.
TL — Time limit exceededCPU time on a test went over the limit, or the program waited longer than twice the limit by the clock.
ML — Memory limit exceededPeak memory went over the limit.
RE — Runtime errorThe program exited with a non-zero code or by a signal.
OL — Output limit exceededMore than 64 MB of output on a test.
CE — Compilation errorThe code did not compile (for Python, a syntax error). Not counted as an attempt.
SE — Judge errorThe judge itself failed, for example your checker. It costs the entrant nothing; the submission can be rejudged.

Set up a contest

  1. In the panel open Contests and press NEW CONTEST. Give it a title and an address: the class opens the contest at /a/<address>.
  2. Under Basics write the line for the list and an introduction: the rules of the class, what may be used. The introduction is Markdown with $…$ formulas.
  3. Add problems (+ new problem). Their order is their letters A, B, C…; drag a row to reorder.
  4. Choose the scoring rules, the schedule and the languages (each is below).
  5. When every problem's reference solution passes all its tests, press Open the contest. While something is in the way, the button says what.

View as a participant opens the contest's page as the class will see it, even for a draft.

A problem: statement and limits

The problem editor holds the statement in Markdown (formulas in $…$), the time limit per test and the memory limit. Time is CPU time: Python gets the same seconds as C++, so if the problem is about complexity, check the reference in Python. Do not copy the examples into the statement: entrants see the tests marked example under it, with a copy button.

How the output is compared with the answer:

  • by words — words through any spaces and line breaks; how most problems are checked;
  • by lines — whole lines, without trailing spaces and trailing empty lines;
  • numbers within an epsilon — by words, and numbers match when they differ by no more than the epsilon (absolute or relative);
  • own checker in Python — when there is more than one right answer. Write a function:
def check(input: str, output: str, answer: str) -> bool:
    # input is the test, output is the entrant's output, answer is yours
    ...

Return True/False or a pair (False, 'note'): you see the note, and the entrant does on examples. An exception in the checker is a judge error (SE), not the entrant's loss.

Tests

Upload an archive takes a .zip in the usual layouts; there is no need to rearrange them:

LayoutExample
Polygon, Yandex.Contesttests/01 and tests/01.a
in/out1.in and 1.out (or .ans, .a)
foldersinput/input1.txt and output/output1.txt

Tests run in the order of the numbers in their names. A test can also be added by hand (+ test by hand), marked as an example, deleted. Answers need not be uploaded: Answers from the reference runs the reference on the tests without an answer and records what it printed.

Changed the tests after submissions came in? In the console press Rejudge a problem…: the submissions are judged on the new tests and the board is recounted.

The reference solution

The reference is your solution of the problem. It is judged exactly like a submission, with the same limits, and shows its slowest test and peak memory, so you can see the margin you left the class. Until the reference passes every test of the current version, the contest cannot be opened: a problem its author cannot solve means a class hunting for a mistake of their own. Entrants never see the reference.

Scoring rules

ICPC is for a timed class test. A problem is either solved or not. The place goes by problems solved, then by penalty: the minutes from the start to every accepted submission plus a penalty for every rejected attempt before it (20 minutes by default). A compilation error is not an attempt; submissions after an accepted one are judged but no longer change the place.

IOI is for homework. A problem is worth 100 points. equal per test splits them between the tests that are not examples; by groups pays a group only when all of its tests pass. The best submission of every problem counts, and the place goes by the sum.

Places on the board are always distinct: on equal results, whoever got their last accepted submission earlier is higher (IOI: whoever reached their sum earlier).

Attempts per problem limits the submissions per problem; compilation errors and judge errors do not spend it.

The freeze and the reveal

The freeze is an ICPC tradition: the set number of minutes before the end, the board stops showing other people's new results. Everyone still sees their own verdicts, and other people's attempts after the freeze show as ? with the number of attempts. The board stays frozen after the end until you press Unfreeze, so the results can be revealed at the review, with the whole class.

Schedule and upsolving

The start and the end are in the instance's time zone. Before the start an entrant sees a countdown and no problems. After the end submissions close, unless Upsolving after the end is on: then submissions are taken and judged but stay off the board. Extend in the console moves the end; Finish now closes submissions at once.

Languages

Python 3, C++20 (g++ -std=gnu++20 -O2) and C17 (gcc -std=gnu17 -O2 -lm). The compilers come from the contest's environment — the same image as class kernels; the editor shows their versions. If the environment's image has no compiler, the language is marked unavailable.

How a submission is judged

Every submission gets one throwaway container without network, with a read-only root and a process limit. Inside, the judging process compiles the solution and runs it on every test as an unprivileged user, each test with its own CPU time, memory, output size and stack limits, on one core. ICPC stops at the first failed test; IOI runs every test, skipping the rest of a group after a failure. The entrant watches the progress live, «test 7 of 22».

The queue is one per instance and survives a server restart. Your reference runs go first, then submissions by time, and one entrant has at most one submission judged at a time. How many are judged at once is shown and set on the JUDGE strip above the contests list, where judging can also be paused.

The board and the projector

An ICPC board shows «+» or «+2» with the minutes of the solution in a cell, failed attempts as «−3», the first solution of a problem as a filled cell, and at the bottom how many solved each problem and how many attempts there were. An IOI cell shows points. An entrant can switch to Near me. Other people's e-mail addresses are shortened, as on competitions; participants only hides the board from everyone but the contest's entrants.

Show on the screen in the console opens a dark projector view with big rows and the countdown, handy to keep on the screen for the whole class. Download CSV exports the board for the grade sheet.

The console of a running contest

An open contest has a console instead of the editor: the feed of submissions with filters by problem, verdict and entrant; a click opens the review on the right — the code, the verdict and the table of tests with time and memory, and for the failed test the program's output beside the answer (hidden tests are visible to you only). Rejudge puts the submission back in the queue. Tabs: Leaderboard (unfrozen), Questions, Problems, Participants and Settings.

Questions and announcements

Under Questions an entrant asks about a problem or in general. You answer with Answer privately, which only the asker sees, or Answer everyone, which turns the question and the answer into an announcement for all. An announcement can be written without a question too. Unread answers put a dot on the tab.

Entrants

A contest's entrant is the same as a competition's: a Telegram username or an e-mail address as the name, and an entry key shaped K7Q-M2X-9FD. Whoever has entered a competition is already signed in to contests. One can join ahead of the start and while the contest runs; submissions without joining are not taken. Remove a person from a contest under Participants: their submissions and their row go with them.