Page 2 of 7

Re: Google Code Jam 2012

Posted: Mon Mar 20, 2017 2:42 pm
by Kirby
I'll give it a shot, again, this year.

I'm pretty rusty, but I guess that's more reason to give it a shot. :study:

Re: Google Code Jam 2012

Posted: Mon Mar 20, 2017 4:14 pm
by Shaddy
I'll give it a shot, if I remember it's happening...

Re: Google Code Jam

Posted: Mon Mar 20, 2017 9:02 pm
by Solomon
Removed 2012 from the title, since it looks like the discussion has changed to 2017 (sorry). Also, I was looking through some of the past contests out of curiosity, and found this interesting problem from 2014 Round 1C :D.

Re: Google Code Jam

Posted: Thu Apr 06, 2017 1:08 pm
by Solomon
Just a friendly reminder that the qualifiers start tomorrow at 23:00 UTC (4pm PST) :). Good luck!

Re: Google Code Jam

Posted: Thu Apr 06, 2017 5:17 pm
by hyperpape
I'm glad you posted that, because I've been mulling over participating and had not realized it started tomorrow afternoon.

How long did the qualifying round take you in previous years?

Re: Google Code Jam

Posted: Thu Apr 06, 2017 5:24 pm
by Kirby
hyperpape wrote:I'm glad you posted that, because I've been mulling over participating and had not realized it started tomorrow afternoon.

How long did the qualifying round take you in previous years?
Probably most useful to take a look at last year's qualifying round, to get a better idea:

https://code.google.com/codejam/contest ... /dashboard

Re: Google Code Jam

Posted: Fri Apr 07, 2017 8:45 am
by Solomon
hyperpape wrote:How long did the qualifying round take you in previous years?
I only participated one other time in 2015, and despite being given 27 hours, I only managed to solve 1 problem (A, the easiest one). Hoping that changes today!

Re: Google Code Jam

Posted: Sat Apr 08, 2017 12:15 am
by Kirby
I ended up doing "Tidy Numbers" small and large, along with "Bathroom Stalls" (the small set). These seemed like the easiest to do, so I worked on them first.

I think my implementation for the large set for "Tidy Numbers" is correct (looking briefly through the output file, it looked OK).

For "Bathroom Stalls", the program I wrote didn't scale. I started out with this problem wanting to represent the stalls as bits in a long, since that should have enough space to hold 10^18 "stalls". But it wasn't immediately clear to me how to quickly calculate Ls and Rs on the bitset. When it got a bit late, I decided to just make a simple brute force solution that would solve the small set (should be enough for 25 points if the large set for "Tidy Numbers" was correct).

I plan to do stuff with my kids tomorrow, so I probably won't complete the others. Just skimming the other problems, pancake flipping seemed like a dynamic programming problem, and I didn't think about the last one that much (brute force?).

It was a fun Friday activity. Hopefully my large for "Tidy Numbers" was correct so I have incentive to continue for the next round.

Re: Google Code Jam

Posted: Sat Apr 08, 2017 4:16 am
by Shaddy
It is 4 AM. I can't stop thinking about D. Fashion Show. I think I've figured it out..

Re: Google Code Jam

Posted: Sat Apr 08, 2017 5:28 am
by hyperpape
I haven't actually submitted anything yet, but I have a solution written and tested for Tidy Numbers. It took me longer than I expected, maybe an hour? Lots of ugly nested conditionals. I'm about halfway through a solution Bathroom Stalls, and I think my approach will scale to the large set.

Fashion and the Pancake Flipper, I don't really know what to do.

Re: Google Code Jam

Posted: Sat Apr 08, 2017 9:33 am
by gamesorry
I'm traveling in Boston so only had time to code up the first two problems last night. For problem 3 I figured out some properties. Will see if I could verify them tonight before the contest ends...

Re: Google Code Jam

Posted: Sat Apr 08, 2017 10:35 am
by HermanHiddema
Decided to give it a try too :)

Problem 1 (pancake flipping) was easy. Took me about 15 minutes to get a linear time solution (O(N) where N is the number of pancackes)

Problem 2 (tidy numbers) was also easy. Took me about 30 minutes for a linear time solution (O(N) where N is the number of digits)

Problem 3 (bathroom stalls) was slightly more difficult, but not hard. I had a logarithmic time solution (O(log2N) where N is the number of people) in an hour, but it took me another hour to find the off-by-one error that made my first submission incorrect. Typical case of having <= instead of < somewhere and failing on rare edge cases. Actually coded another (linear time) solution to find the error :mrgreen:

Problem 4 (fashion models) I'm probably not going to try. I have some ideas, but I have another appointment right now, and the contest closes in about 8 hours. Maybe when I get back, if I haven't drank too much for it :)

Re: Google Code Jam

Posted: Sat Apr 08, 2017 11:30 am
by Kirby
Wow, you guys are fast :-)

At the zoo with my kids now so I won't be able to get more points before the 27 hours, but I feel compelled to finish the rest now.

Re: Google Code Jam

Posted: Sat Apr 08, 2017 12:00 pm
by hyperpape
Herman is not only fast, but also weird! Pancakes are obviously harder than Tidy Numbers or Bathroom Stalls. At least he agrees the fashion show one was harder than the other three.

Re: Google Code Jam

Posted: Sat Apr 08, 2017 12:34 pm
by Shaddy
hyperpape wrote:Herman is not only fast, but also weird! Pancakes are obviously harder than Tidy Numbers or Bathroom Stalls. At least he agrees the fashion show one was harder than the other three.
I also thought pancakes was the easiest.