google-code-jam

Code Golf: Decision Tree

In Google Code Jam 2009, Round 1B, there is a problem called Decision Tree that lent itself to rather creative solutions. Post your shortest solution; I'll update the Accepted Answer to the current shortest entry on a semi-frequent basis, assuming you didn't just create a new language just to solve this problem. :-P Current rankings: ...

awkward monad transformer stack

Solving a problem from Google Code Jam (2009.1A.A: "Multi-base happiness") I came up with an awkward (code-wise) solution, and I'm interested in how it could be improved. The problem description, shortly, is: Find the smallest number bigger than 1 for which iteratively calculating the sum of squares of digits reaches 1, for all bases fr...

Google Code Jam 2008: Round 1A Question 3

At Google Code Jam 2008 round 1A, there is problem: Calculate last three digits before the decimal point for the number (3+sqrt(5))^n n can be big number up to 1000000. For example: if n = 2 then (3+sqrt(5))^2 = 27.4164079... answer is 027. For n = 3: (3+sqrt(5))^3 = 3**935**.73982... answer is 935. One of the solution i...

Double precision values

Just a day before I participated in the qualification round of Google Code Jam. This is my first experience of such an online coding contest. It was really fun. There were three problems given of which i was able to solve two. But on one of the problems I was asked to work with values that are really huge. I am a Java guy and I thought ...

File Fix-it codegolf (GCJ 2010 1B-A)

Last year (2009), the Google Code Jam featured an interesting problem as the first problem in Round 1B: Decision Tree As the problem seemed tailored for Lisp-like languages, we spontaneously had an exciting codegolf here on SO, in which a few languages managed to solve the problem in fewer characters than any Lisp variety, using quite a...