[gcj] Re: Fair handicap

2009-09-26 Thread Grant Kot
well, you don't have to worry about me, i didn't solve a single problem set. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups google-codejam group. To post to this group, send email to google-code@googlegroups.com To

[gcj] Re: Round 1C - Problem B - Center Mass

2009-09-14 Thread Grant Kot
Perhaps there's a problem with handling the special case where the speed averages to zero? At that point any time between the minimum and maximum would give you the minimum distance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[gcj] Re: Round 1C - All your Base

2009-09-13 Thread Grant Kot
yeah, besides i guess it wouldn't really change the algorithm much, you just have to test twice with a reverse and if you get the left to right the right to left is just redundant. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[gcj] Re: Round 1C - B. Center of Mass

2009-09-13 Thread Grant Kot
oh, in the practice i just formatted the numbers like the sample to be safe. so anyway, the algorithm i used for this was just that the center of mass will move at a constant speed if the speed of all the fireflies stay the same. so i just used a dot product and used that to find the tmin.

[gcj] Re: Round 1C - B. Center of Mass

2009-09-13 Thread Grant Kot
I don't think this was linear programming. Basically, all you need to know is that with all the velocities constant, the center of mass will move at the average of the velocities, a straight line. It's not going to curve or anything. Then, you need to know how to find the closest point on this ray

[gcj] Re: Round 1C All your Bases

2009-09-13 Thread Grant Kot
Well, to stay away from precision issues, i just kept track of a variable i called mul and for each iteration i multiplied the current digit by mul and after that multiplied mul by the base, so for base 3 it goes from 1 to 3 to 9 and so on. When I had the special case when there was only one

[gcj] Re: Multibase - all bases 10?

2009-09-12 Thread Grant Kot
yeah, i didn't read this part carefully enough either so i timed out and didn't have time to change my program. i just made one with caching and it's pretty naive but it still goes in 1 minute. it speeds up nicely as everything starts getting cached at the end.

[gcj] Re: next_permutation() in java

2009-09-12 Thread Grant Kot
there's a language that has that? anyway, wikipedia has sums everything up nicely in four easy steps: The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place. 1. Find the highest index *i* such that s[i]

[gcj] Re: next_permutation() in java

2009-09-12 Thread Grant Kot
Cool, Sumudu, with your suggestion I was able to shorten my code by half! So it's pretty short even without next_permutation(). But that basically means that if someone has next permutation they could solve it with almost no code at all. StreamReader reader = new StreamReader(input.in);

[gcj] Re: how can I know if I am qualified to the round 2

2009-09-11 Thread Grant Kot
well this is weird, i only did the small input for A and i am rank 861. for the large i timed out because i didn't read the part where the bases were under ten, i thought they could be arbitrary and thus didn't optimize as well as i could have, so after that half hour i just quit thinking there

[gcj] Re: how is everyone going on the qualification round

2009-09-04 Thread Grant Kot
Contest analysis has already been posted: http://code.google.com/codejam/contest/dashboard?c=90101#s=a --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups google-codejam group. To post to this group, send email to

[gcj] Re: hey all

2009-09-03 Thread Grant Kot
yeah, this contest has told me that i really need to study up on algorithms. it's also scary that the fast person completed all three in less than half an hour. i got large and small for A and B correct but for C somehow I had a recursive thing and it took forever and I couldn't figure out how to

[gcj] Re: query on qualification round

2009-09-02 Thread Grant Kot
Well, if it works on the large data set it should probably work on the small. I don't see why anyone wouldn't test on the small as if it doesn't work there it sure as heck won't work on the large. Grant Kot On Sep 2, 2009, at 2:13 PM, Anurag Dongre anurag.dongr...@gmail.com wrote: YEAH i

Re: Does speed of execution of the program matter?

2009-08-13 Thread Grant Kot
yeah, i guess the sizes of these datasets are kinda small to be able to take advantage of massively parallel stuff. but it could help with some inefficient brute force algorithm. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: can somebody help me plz!!!!!!!!111

2009-08-11 Thread Grant Kot
it is open now i think? http://code.google.com/codejam/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups google-codejam group. To post to this group, send email to google-code@googlegroups.com To unsubscribe from