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
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
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
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.
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
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
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.
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]
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);
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
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
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
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
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
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
15 matches
Mail list logo