Jump to content
xisto Community
Sign in to follow this  
Nabb

Sphere Online Judge (spoj) Programming Challenge Website

Recommended Posts

Here's an interesting website for you all: SPOJ

 

 

Basically this website is a test of your programming skills. This is similar to some other websites, such as Project Euler, but different...

 

The website poses thousands of different programming problems which you must solve. Here's an example problem:

It's easy to know that arctan(1/2)+arctan(1/3)=arctan(1). The problem is, to some fixed number A, you have to write a program to calculate the minimum sum B+C. A, B and C are all positive integers and satisfy the equation below:

arctan(1/A)=arctan(1/:D+arctan(1/C)

As to the way this website differs to others, it is an online judge. In a website like Project Euler, you might be posed this problem and be told that A = 873452763 (I think that makes the answer about 76.292 quadrillion - I should've picked a better number :D). However at SPOJ, you aren't told A. You must write a script which reads via standard input the value of A and outputs the sum B+C to standard output, and submit the code. This allows for some restrictions, such as:

Time limit: 1s

Source limit: 256B


And some other restrictions like:

Languages: WSPC BF ICK

Yep, some problems force you to use an esoteric language! (different problem - the one above gave me a time limit exceeded error for WSPC :D)

 

You can view best solutions (time/memory, not the code :lol:), and smile that you're the only person who completed the problem in Whitespace (infix to RPN in Whitespace, go me!)

 

You can see compilation errors if there are any (same problem as above, PHP and WSPC didn't cut it so I learnt a new language.. got it out eventually ^_^)

py_compile.PyCompileError: File "/sources/tested.py", line 8

n--

 

^

SyntaxError: invalid syntax


There are challenge problems too, which gives you a score based on how good your code is and ranks that

Output must contain as many digits of PI as possible (not more than 1000000).

The score awarded to your program will be the first position of the digit where the first difference occurred.

(there's a file size limit, no uploading 5Mb of Pi xD, as well as the usual time limit... this one is 25s and 4kb.)

 

You can get results emailed to you, but I have no idea why you'd need that as none of the scripts are going to be taking more than a minute - most scripts have a 1 second time limit!

 

They apparently have contests every now and then, I wouldn't really know because I'm new to the site, but at the moment there's a contest for High School students! Check it out and tell your teachers to pay for you to join it :D

 

Enjoy the website :D It's got me hooked on Whitespace, but that's probably because PHP is so darn slow!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.