tags:

views:

356

answers:

4

Hi, I'm wondering what's a good online judge for just practicing algorithms. I'm currently not very good at writing algorithms, so probably something easy (and least frustrating) would be good.

I've tried the UVA online judge, but it took me about 20 tries to get the first example question right; There was absolutely no documentation on how to read input, etc. I've read about Topcoder, but I'm not really looking to compete, merely to practice.

+2  A: 

Take a better look at topcoder. Yes, they have competitions, but you can still easily just "play" by yourself. You are given a goal and a time limit and you choose your language, and then you code it. You can view the source code of the best coders to improve yourself.

I have used topcoder for awhile and have never been in any competition. Check it out.

You may also want to check out Project Euler. Not a judge, but there are mathematical problems and solutions available for many languages.

ryeguy
+2  A: 

Have a look at SPOJ

lumen
A: 

This is a year old by now, so my answer is for future stumblers.

The UVa site has a lot of great problems, and in a lot of different areas. (Project Euler is also great, but the problems are all number-theoretic.) And hoop-jumping is normal with these things... last I checked, Facebook Puzzles requires you to email a zip file containing the code and an Ant buildfile, and they take a long time to get back to you.

I've only sent Java code to UVa, so I'll elaborate a little on the Java particulars for anyone else who's struggling. Your class must be called Main, and its entry point must be the main method. You read from System.in. If you're on a Unix-y platform, after compiling you can use

Java Main < input.txt

to test your program.

The presentation has to be exact. For example, if they say "outputs should be separated by a blank line," that does not mean, "follow each output with a blank line." Finally, don't be afraid to check out their forums.

Reference: http://online-judge.uva.es/board/viewtopic.php?t=7429

(In their sample code, they read the input byte-by-byte. Don't do that; use Scanner instead. It's also not necessary to have the main method create an instance of the class. You can go 100% static, and often the problems are small enough that OOP doesn't buy you anything.)

John C
A: 

CodingBat might give you some good practice. It responds instantly with test results.

Mike