http://www.spoj.pl

Sphere Online Judge is mainly an automatically judged, ongoing programming competition consisting of lots of problems you can solve in one of a wide number of languages. There are also periodic sub-contests, and the ability to run your own contests.

The Problems

The problems are arranged as a long, sortable, paged list; there are a few thousand, in a wide range of difficulties. Each problem has a fairly short, all uppercase name (such as KAMIL) used to refer to them in URLs, on the submission form and on the forum.

Difficulty: Some of the problems are extremely easy, so long as you understand the specified input and output. There is an introductory problem (worth no points) for which a solution is provided by the site itself. On the other hand, some problems have not yet been solved, or have stumped all but 10 or 12 of an audience of thousands. There are a good number of problems that are in between, that have been solved by a few hundred users. Try your hand at those first.

Description: Each problem has a specified input, a specified output format, a problem description, a runtime limit (large to allow languages like perl) and occasionally a list of accepted languages or program size limit.

Scoring: Normal problems are scored based inversely on how many people have solved them. If you can get more than .2 or .3 for solving a normal problem, you're better than me. Challenge problems are scored based on some performance factor of the program you submitted - how fast it runs, how well it answers, how long the entry is...

Languages

The programming languages available include about anything you're likely to want to use, so long as it is available under Linux. This includes about everything from Nemerle to bash. I've submitted solutions in Scheme, Perl, Ruby, C and bash. I intend to try a problem in Common Lisp soon.

Entries are provided that pass the introductory problem, so that you can test the system and get a little help with input and output code.

The time limits are supposed to accommodate the slower languages, so long as the implementation is reasonable; if it isn't running fast enough, you're probably doing it wrong. There is the option to see results by speed, though, and the results are not surprising, except for Haskell sometimes popping up near the top.

Oddities

True story from FreeNode, while attempting to get a good SIZECON entry:

You have joined #perl
quamaretto: http://www.spoj.pl/problems/SIZECON/
quamaretto: Some nutjob managed to do this in 7 characters
mauke: HA HA, GUESS WHO!

There is a problem called SIZECON in which the contest is to write the shortest program totaling all the positive integers in a list; the shortest entry is only six characters of perl, due to a weakness in the judging system! Another size contest, KAMIL, has a shortest answer in 24 characters of perl. (My entry is only down to 27.)

There is also a special "normal" problem that may only be answered in brainfuck, whitespace or Intercal. It wasn't too difficult for me to solve, but I'm not telling you how I did it!

Happy hacking and watch for traps

My current score is exactly 4; let me know if you top me and I'll cast aspersions on your ancestry. Look me up (as 'quamaretto') to see a list of problems I've solved.

(A few weeks after writing, I was down to a score of 3.8. This is what happens when you abuse the easy but undersolved problems.)

Hints:If you participate, do keep in mind that the input and output are specified and are generally strict, except for leniency about a trailing newline. Also, here's a hint: Many problems are mostly solved with a little thought; few early problems warrant using a complicated algorithm or data structure of any sort. Some problems might even be considered unsporting, encouraging outright guesswork over careful thought... But not very many.

A good way to find problems initially is to sort by users, and find a problem solved by (at the moment) 400-600 users. Not very many points, but not terribly difficult.

A final note: Sadly, dc is not available from the bash environment. Don't spend hours figuring this out like I did.

Log in or register to write something here or to contact authors.