I’m participating in the 2010 code jam and I solved two of the problems for the small data sets, but I’m not even close to solving the large data sets in the 8 minute time frame.
I’m wondering if anyone out there has solved the large data set:
- What hardware were you running on?
- What language were you running on?
- What performance tuning techniques did you do on your code to run as fast as possible?
I’m writing the solutions in Ruby, which is not my day to day language, and executing them on my Macbook Pro.
My solutions for problem A and problem C are on github at http://github.com/tjboudreaux/codejam2010.
I’d appreciate any suggestions that you may have.
FWIW, I have alot of experience in C++ from college, my primary language is PHP, and my “sandbox” language is Ruby.
Was I just a bit ambitious by taking a shot at this in Ruby, not knowing where the language struggles for performance, or does anyone see anything that’s a redflag as to why I can’t complete the large dataset in time to submit.
I made the same mistake. I write in Python, which is inherently slower than other languages due to its interpreted nature. I tried compiling it to C++ code with ShedSkin, but my algorithm was still too slow.
My solution to the Snapper Chain simply “acted out” the scenario. Pseudocode:
I later realized a solution based on the fact that (2^n)-1 == a binary number with n-1 right-justified 1’s, but by then I had long since run out of time on the large set.
EDIT: There’s a way better solution in the Contest Analysis page on the Code Jam Dashboard.