SPOJ (Sphere Online Judge) is an online judge system with over 1 million registered users and over 20,000 problems. Tasks are prepared by its community of problem setters or are taken from previous programming contests. SPOJ allows advanced users to organize contests under their own rules and also includes a forum where programmers can discuss how to solve a particular problem.
Apart from the English language, SPOJ also offers its content in Polish, Portuguese and Vietnamese languages. The solution to problems can be submitted in over 40 programming languages, including esoteric ones, via the Sphere Engine. It is run by the Polish company Sphere Research Labs.[1]
The website is considered both an automated evaluator of user-submitted programs as well as an online learning platform to help people understand and solve computational tasks. It also allows students to compare paradigms and approaches with a wide variety of languages.
This system was originally created to apply an online judge in the teaching of students. It basically focused on the students and lecturers of universities and members of a wider programming community, interested in algorithms and programming contests.
It aimed at different users for different purposes such as:[2]
The archived problems in SPOJ are divided in 5 categories:[3]
There may be limitations on submissions to make a problem more challenging. This includes the availability of languages (e.g. only esoteric languages) and computation time.
Submissions are judged on one cluster:[4]
Programs are checked either by comparison to a known correct answer or by running a dedicated judging code, unique to each problem.[5] This is increasingly necessary when there may be multiple answers in more complex problems. By using a computer, the marking is consistent, fair and can measure efficiency in real time, in comparison to human judging.
To ensure that the system runs effectively, the Linux commands RLIMIT_CPU stops poorly designed tests from affecting others. The chroot system call applies restrictions to the running of programs by using file system sandboxes: the sleep command, for example, is not permitted, as it would reduce the available memory.
The accessible, free and objective nature of the website allow students to gain logical and design experience based on previous successes. However, the system doesn't evaluate code quality, documentation or other more subjective characteristics which may be more important for real world applications.
After being submitted, a user is told whether the code produced an error while running or compiling; the time limit was exceeded; the wrong answer was output or was correct. Challenge problems' answers are accompanied by a score (see below).
The scores are given based on the category in which problems are divided.[6]
\tfrac{80}{40+number\of\people\who\have\solved\it |
Scores for the 'challenge' category are typically the size of the submission in bytes, though may different. For example, it may be the number of correct decimal places of the constant π.
Note: SPOJ frequently change the formulae used for calculating the scores
SPOJ is used as a platform for a wide array of competitions, from local to international level and from short 1 hour problems to year-long leagues. Participants typically speak different languages so site ensures a more level playing field, as well as reducing the work load of the organisers.
Users of online judge systems have little incentive for documentation and creating well-structured code, possibly making them less prepared for more typical applications of computing outside of competitions.
Results of a study conducted at Gdańsk University of Technology suggest that deadlines given in university situations, including bonus and penalty points depending on when an assignment is handed in, tend to be harsh on students who are not well organised, even if the same code is submitted. This has mixed motivational effects on students, encouraging some to keep up with deadlines, while demotivating others. The same study indicates that use of online judge systems lead to a reduction in communication between students and staff. However, in the case of staff with high teaching load, this reduction may allow staff to devote more of their time to students with difficulties, eliminating administrative overheads related to grading and time spent on discussions with students who do not need assistance.
SPOJ supports about 60 languages in which the users can submit their solutions. These include:
Ada, Assembler, AWK, Bash, Brainfuck, C, C++ and C99 strict, C#, Clojure, Common Lisp, D, Doc(no testing), Erlang, Fortran, F#, Go, Haskell, Icon, Intercal, Jar, Java, JavaScript, Lisp, Lua, Nemerle, Nice, Node.js, OCaml, Pascal, Pdf, Perl, PHP, Pike, PostScript, Prolog, Python, Ruby, Rust, Scala, Scheme, sed, Smalltalk, Tcl, Tecs, Text, and Whitespace.