Pages

Saturday, November 9, 2013

Getting started with Sphere Online Judge (SPOJ)

SPOJ is an online programming website with more than 100,000 registered users and over 10000 problems. It is an online judge system like TopCoder and UVA, in which you can submit solution of problems 24 hours/day in over 40 languages including C, C++, JAVA, C#, Python, Perl and JavaScript. This site is ideal for both beginner as well as expert coders to practice and compete with other coders globally.

Here is the SPOJ's official website link. Apart from the English language, SPOJ is also available in Polish, Portuguese and Vietnamese languages.


First of all, you should have to create an SPOJ account here.
Once you are done with creating your account, you can start browsing various sections of the website to get acquainted with how the Sphere Online Judge works. Selection of first problem is one of the biggest problem for beginners...always try to select an easy problem to understand the code submission process of SPOJ. The best indicator of problems difficulty level is number of users who had solved it and percentage of accepted solutions, more is the percentage easier the problem. I will recommend solving Life, the Universe, and Everything problem first.

Problems are currently divided into four categories: 


        CLASSICAL -  Binary scored problems(maximum problems in this category)        
        CHALLENGE -  Difficult problems belongs to this category
        TUTORIAL  -  Easier than classical based on standard known Algorithms
        PARTIAL   -  Little bit easier than challenges, but for educational purpose

Submitting a solution


One you selected one problem from above mentioned problem categories, you can start writing code for it on you IDE. Use the submit link at the top left corner of the problem description page or you can submit you solution from submission page.On submission page you have to paste your code, select language from drop down menu, enter problem code and click Send button. You can get problem code from problem description page or from the problem URL.

You will be redirected to status page where you can watch the progress of judging your solution. After few moments you will see the result:
AC - accepted - your program ran successfully and gave a correct answer. Congrats :)

WA - wrong answer - your program ran successfully, but the output produced by your program is    not matching with the expected output.(Some problem in your code, you should debug it.)

TLE - time limit exceeded - your program was compiled successfully, and was running properly but it didn't processed all the given inputs before time limit specified in the problem description. This may be because time complexity of your algorithm is more or you program goes into an infinite loop.

CE - compilation error - your code failed during compilation step, the details of the compilation error can be accessed from status page.

RE - runtime error - your program ran successfully for some time, but it exited with a runtime error before processing all given inputs. It can happen due to many reasons like, "segmentation fault", "output limit exceeded", "floating point error" etc.

Source code of your solution


All of your solutions are available in your profile (click on history of submissions in your profile page). To check the source code of your submission click on the ID number in submission list
(i.e. status page, history of submissions; you can do the same when you go to problem page and click on My submissions, All submissions, Best solutions). Source code of your submissions is visible only to you.

Ranking in SPOJ 


You can see your current world ranking by clicking on my account (in top-left corner). Your ranking depends upon how many question you solved till now. The points you will get on solving a problem depends upon how many other coders successfully solved the problem.

At present points are awarded to each user as follows:

    for solving classical problem p: 80/(40+number_of_people_who_have_solved p) points
    for a top score in any challenge: 3 points,
    for any lower score in a challenge: (user's_score relative_to_the top_score) points.

SPOJ publishes individual as well as aggregate rank list: 


No comments:

Post a Comment