187 karma · joined April 21, 2013
There's an easy solution when you're looking for an average salary (and everyone doesn't mind doing a little bit of calculation). The first person thinks of a random number, adds his salary to it and tells it to the person on his/her right (so noone else hears!). The next one adds his salary and tells it to the next person and so on. When it re-reaches the first person, he then subtracts the original random number. The result is the sum of their salaries, which can then be divided to yield an average. All done in a way that no one person learns what the salary of any other person was.
[1]: http://en.wikipedia.org/wiki/Yaos_Millionaires_Problem (link sadly broken by HN url parsing?)
That doesn't mean that there aren't also people who have done the same and still prefer python (or some other language) not for execution, but development speed (and bignum, larger standard library...)
By memory, there were under 50000 such palindromes in range 0..10^100.
One thing that Code Jam does differently (and imho better) is that they give you an input set and you have 8 minutes (or so) to upload the solution. This is expected to give more than enough space for language speed variance.
Instead of execution time, coding time is much more precious in such competitions, and
Micro-optimizing has it's place, but it's usually not in a programming competition. that's what using ruby instead of C gives you leverage for that, as you can express more complex ideas and algorithms more easily (which should be the focus point).
This doesn't mean you shouldn't know the cost of operations.