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:
QUOTE
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/B)+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 tongue.gif). 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:
QUOTE
Time limit: 1s
Source limit: 256B


And some other restrictions like:
QUOTE
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 sad.gif)

You can view best solutions (time/memory, not the code smile.gif), 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 smile.gif)
QUOTE
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
QUOTE
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 tongue.gif

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

 

 

 


Comment/Reply (w/o sign-up)