The Programming Contests, Challenges and Online Judge Thread.

Sykora

I see right through you.
Since we have quite a few knowledgeable programmers and more than a few budding programmers, I thought it'd be useful if we had a thread on programming challenges and the like.

In general,

  • Contests are usually played out between participants in realtime.
  • Challenges are mostly formats where you do the problem in your own time and submit the answer -- your score will increase if your answer verified.
  • Online Judges are similar to challenges, but require you to submit the code itself, rather than the answer. The code will be run on the server, and you'll be told if your program passed. Online Judges are usually more difficult than Challenges becuase the server imposes a time limit.

These are some of the challenges I've found the most interesting :

1. Project Euler

Site : *projecteuler.net

Languages : Anything

My favorite up first. Project Euler is a collection of (mostly) mathematical problems that (in general) you'll have to write some sort of program to solve. It's a challenge (in the above sense of the word), so you have as much time as you want to solve the problems in any order using any language. It has the usual ranking system so you can compare yourself to everyone else, as well as within your country. New puzzles are added almost every month or so, but it can vary. The problems range from ridiculously easy, to impossibly hard. There are currently 170 of them. Another thing I like about this one is that each problem has its own forum thread, where people post how they solved it, with the code they used. However one can access the thread for a problem only if they've solved it.

2. Sphere Online Judge (SPOJ)

Site : *spoj.pl

Languages : Lots, 35 to be exact. And yes, you can submit in Brainf*ck Check the site for the full list.

SPOJ is good because it combines problems from almost every other source. They're not mathematical, just normal Computer Science problems. The 3 main limitations that they place on you are the running time, memory usage and code size. There are almost 2000 problems, most of them are easy to solve in general, but hard to solve within the restraints imposed.

3. UVa Online Judge

Site : *icpcres.ecs.baylor.edu/onlinejudge/

Languages : C, C++, Java, Pascal

The same as SPOJ, except you can only use those 4 languages. For this reason, I prefer SPOJ. Same format though, and lots of problems. Some of them are duplicates of SPOJ (or may be the other way around), but for the most part doable.

4. The Python Challenge

Site : *pythonchallenge.com

Languages : It should be obvious...

A dedicated challenge for my favorite language. As far as format goes, it's the same as KlueLESS, but with some required knowledge of Python. For some levels you'll need extra modules not provided with the standard distribution, but all of them are free downloads. This is possibly the best way to get interested in Python. There are 33 levels, and they get hard fairly quickly.

5. OSIX : The Open Source Institute.

Site : *osix.net

Languages : Any

Don't let the name fool you, there isn't much relation to Open Source. OSIX has a number of challenges, including the main "Geek Challenges" which are a series of problems one after the other. The problems are very interesting, but also get hard fairly quickly. Other problem types involve Bonus Levels, which are what you do when you get stuck on the main Geek Challenge. You can attempt these in any order. They also have reverse engineering challenges, and tests for various topics. The site is a bit buggy though, it forgets I'm logged in and keeps asking me for my password and I never get anything done. But that's probably my fault.

6. Code Golf

Site : *codegolf.com

Languages : Python, Perl, Ruby

The main focus of code golf is to solve the problem using the minimum number of keystrokes. The problems here are amazingly thought out, and the site in general is nice to read (no programming relevance, but it helps). You are ranked based on the number of bytes of your code, so the shorter the better. Solving these problems is by no means difficult. Coming anywhere near the top scores is insanely hard.

Post here if you're already doing any of these challenges, and definitely post if you've found another challenge that I haven't noted, I'll update my list.

We can discuss the problems, but some of these have very dedicated communities which do not post the solutions to the problems anywhere. I'd like to keep that going, because it takes the fun out of things.
 
Last edited:

QwertyManiac

Commander in Chief
Great list! I just knew two of them so far. Code Golf looks like the place where you can rack your brains for short-and-sweet programming, I'll definitely try that one, in addition with the hard nights "The Python Challenge" (On level 12) and Project Euler (4 problems so far) are giving me right now.

Guess you missed the UVa link.
 
F

FilledVoid

Guest
Aren't we allowed to use the other Diagonal as well?
 

QwertyManiac

Commander in Chief
Whoops, yeah.

My bad :|

Thank you!

Solved 3 today so am slightly unstable perhaps :p
 
Last edited:
F

FilledVoid

Guest
Lol. No problems . Ive stopped for today. I think I got three today(thats all I have :D )
 

QwertyManiac

Commander in Chief
I've done 15 so far in Project Euler. Will dedicate today back to Python Challenge (Still where I said I was).
 
OP
Sykora

Sykora

I see right through you.
Fixed the UVa link.

My residential gateway screwed with my solution to #12 at the python challenge, so I had to run it on a different computer.

I still haven't gotten #18 at projecteuler. I refuse to try out all the paths :|.

@exx : What's your username at projecteuler?
 

QwertyManiac

Commander in Chief
You could try Graph Theory in #18? I'll try that later ... Two of my solutions so far have taken over 25-50 seconds to solve (Brute Force :p)
 
F

FilledVoid

Guest
Sykora said:
@exx : What's your username at projecteuler?

BijuMathew is my username there. I might sound like a hypocrite here but I think that Brute Force isn't exactly a good way to go through these problems. But thats just my theory . However finding a good algorithm to go through most of the problems isnt going to be an easy process either.
 
OP
Sykora

Sykora

I see right through you.
Most of the problems are _designed_ to defeat bruteforce techniques. That's why they give crazy limits of 10**100, etc. As they've stated, all problems can be solved by a program in under a minute on a reasonable machine.
 

QwertyManiac

Commander in Chief
Well I had to use Brute Force for the first Prime Number related problem since I've never studied much about them. Later I refined the method (including the skips and other things, with a little help from Dromey's How to Solve it by Computer) for the next puzzle.
 

The_Devil_Himself

die blizzard die! D3?
me too joined euler but only solved first three,got exams in a few days so no time.

I am not as skilled as you guys in programming but I'll try.I only know basics of c\c++.WIll try to get hold of python after the exams.
 

QwertyManiac

Commander in Chief
Any language works for Euler ... Not necessary to go for Python. Its slow anyway, if your methods are brutish.
 
F

FilledVoid

Guest
am not as skilled as you guys in programming but I'll try.I only know basics of c\c++.WIll try to get hold of python after the exams.

I used Excel for the first few problems :D . Im trying to stay away from languages but it seems other than a handful everythign needs to be done with some language etc.
 

QwertyManiac

Commander in Chief
About the 18th one. I think I found a way out. Start from the bottom and test which possible addition to the above row gets the maximum value. Eliminate the minimum ones as you go up (max() should be of assistance).

But the main clue is to start from the bottom and go up. This way you don't see all possible paths exactly, so should work for 67 too? I'll try that one later. Passed 18 for now :))

Done 67 as well. :)

Timestamp:
Code:
real    0m0.043s
user    0m0.036s
sys     0m0.004s
 
Last edited:
Top Bottom