Google Code Jam is upon us, the Qualification Round has begun, with roughly 16 hours left to complete at least one of the three questions completely. There are at least 4000 contestants who have made it passed the qualification round so far. I'd predict there to be between 6000-8000 people who make it through the qualification round by the end of the 24 hours.
The three questions this year are of varying degrees of difficulty.
The first, "Snapper Chain" deals with trying to figure out if a certain light will be turned ON after a certain number of snaps (working just like a clapper), the catch is that there can be an infinitely long chain of these snappers, so the 2nd one would only turn ON, if the first one is already supplying it power. Many people can see pretty quickly that this breaks down mathematically to a very simple power of two equation.
The second question "Fair Warning" is, in my opinion, the hardest of all three questions posed. For this you, you are given a certain number of events that occured in the past, and the number of seconds ago that they occurred. The task is to find a singularity point for all of these events at the current time or at X seconds in the future. The singularity is the point in time where all the events time in the past is factor able by the constant T. The catch is that you want to find X based on the maximum value of T.
As this is the hardest and took me a few minutes to conceptualize, let me offer a tip on how to think about this problem and where to get started.
Lets say I give you two numbers 100 and 200. If I asked you if 150 could possibly be a factor of both of those numbers you would say no. The reason you would know that is because the difference between those two numbers is less than the factor I gave you...
This is the only hint I will give. I'd give too much of the answer away if I say more.
The third question "Theme Park" is easy for the small set, but tricky for the larger one. I actually messed up on the larger one because I couldn't finish altering my code in the 8 minute time segment you have to submit the large answer set. This problem deals with roller coasters. You are given the capacity of a roller coaster, and the number of times it will run in a day. You are also given groups of people who are together in line (i.e. [5 6 2 3 1]). Each person pays $1 for every ride, and people get back in line as soon as they get off the coaster. You have to figure out the coasters revenue for the day. The caveat is that groups wont split up (they stick together like good friends =) There are a few other tricks you'll have to figure out yourself.
Where I went wrong on the large set, is not building in checks for the data. Google gives you completely valid data sets, but they don't just follow the general template like the small set does. I can't tell more, otherwise I will again give away more than I should, but just think of how they could mess with you and your data.
Good Luck to All Competitors,
See You In Round One!
- bsquared
No comments:
Post a Comment