Skip to content

What is LCOJ?

LCOJ (Luyện Code Online Judge) is the online programming judge that runs luyencode.net. You read a problem, write a program, submit it, and get a verdict a few seconds later. Beyond practice, LCOJ is used to run contests, give multiple-choice quizzes, and manage classes.

LCOJ is open-source software built on DMOJ and VNOJ. Anyone can host their own copy for a school, class, or club.

What is an online judge?

An online judge is a website that grades your programs automatically. Every problem has a set of test cases you can't see. When you submit, the system runs your program on each test, compares what it prints with the expected answer, and reports a verdict.

Take the problem "Sum of two numbers": you're given two integers a and b and must print a + b.

cpp
#include <iostream>
int main() {
    long long a, b;
    std::cin >> a >> b;
    std::cout << a + b << '\n';
}

You submit this code. The judge runs it on the hidden tests: input 3 5 must print 8, input -1000000000 -1000000000 must print -2000000000, and so on. If every test passes, you get Accepted (AC). If a test prints the wrong answer, you get Wrong Answer (WA); if it runs too long, Time Limit Exceeded (TLE).

Every verdict is explained in Status codes.

What does LCOJ offer?

FeatureWhere on the siteWhat it's forRead more
Problems/problems/Practice with a library of auto-graded programming problemsSubmitting and judging
Contests/contests/Timed competitions with live rankings and several formats (IOI, ICPC, AtCoder, VNOJ...)Taking part in contests
Quizzes/quizzes/Single-choice, true/false, multiple-answer and short-answer questions, graded on submitTaking a quiz
Exam library/library/Read official past exam papers (PDF) as a flipbook, and jump into the matching contest if there is oneExam library
Organizations/organizations/Group users into teams, classes or schools, with their own private problems and contestsOrganizations
Blog, comments, tickets/blogs/, /tickets/Write posts, discuss problems, report problems with a statementBlog, comments and tickets

Who uses LCOJ?

  • Students practicing programming and preparing for olympiads, the Vietnamese Young Informatics contest, gifted-high-school entrance exams, and ICPC.
  • Teachers who create classes (organizations), assign problems, set programming tests and quizzes, and track their students' results.
  • Problem setters who write problems with test data, checkers and graders.
  • Contest organizers running contests for a club, a school or the wider community.
  • Site admins and operators who host LCOJ on their own server for their institution.

Core concepts

  • A problem is a statement plus a set of test data. The setter uploads the tests and picks how answers are checked.
  • A submission is one attempt at sending your code for a problem.
  • A judge is a machine that runs code in an isolated sandbox against the problem's test data and sends the verdict back to the website.
  • A contest bundles problems into a time window with a scoreboard.
  • An organization groups users, for example one class. It can have problems and contests that only its members see.
  • A quiz is separate: its questions come from a question bank and the website grades them directly, with no judge involved.

Every term is defined in the Glossary.

Choose your path

You areRead firstThen
Student or learnerAccount and sign-in, Submitting and judgingTaking part in contests, Taking a quiz, Status codes
Problem setterYour first problem, Managing problemsProblem format, Checkers, Problem examples
Teacher or contest organizerYour first contest, Organizations (groups, classes)Creating and managing contests, Contest formats, Your first quiz
Site adminPermission system, Managing usersSite configuration and content, URL shortener
Operator or self-hosterArchitecture, Installing with DockerSetting up judges, Day-to-day operations, Updating

Not sure where to start?

If you only want to solve problems on luyencode.net, Submitting and judging is all you need. Common questions are collected in the FAQ.

Origins and license

Most of LCOJ's code comes from DMOJ (a Canadian online judge) and VNOJ (the VNOI community's fork of DMOJ). Many thanks to the DMOJ and VNOJ developers for sharing their work. On top of that base, LCOJ adds features such as quizzes and the exam library.

The code lives in two main repositories: lcoj-docker (Docker Compose, scripts, configuration) and lcoj-site (the Django website). LCOJ is released under AGPL-3.0; see License.

Getting help