The question is simply asking for two consecutive single-colour
regions with the largest combined number of beads.
1. Find the size of the regions, by running through the original
array, keeping a running count of current region size, refreshing the
count whenever the colour changes
2. If the first and last bead have the same colour, combine their
regions
3. Run through the array of region sizes and find the largest sum of 2
consecutive
On 2 Jun 2010, at 15:30, maverick gugu <[email protected]> wrote:
Hi,
I couldn't make it round 2. But being my first time, it was a nice
experience. :-) Hope to get more competitive the next time.
I was just working out on a few programs in the mean time. I found
some difficulty,
This problem is called BROKEN NECKLACE. It would be nice if you can
guide me with respect to C/C++.
Link for problem Statement:
http://www.tjhsst.edu/~rlatimer/assignments2003/usaco3.html
Was wondering if there is any new data structure to be introduced
into this one? like a circular linked list or so. It is a little
tedious with an array.
Good luck for those who have made it to round 2.
Thanks,
Maverick
--
You received this message because you are subscribed to the Google
Groups "google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected]
.
For more options, visit this group at http://groups.google.com/group/google-code?hl=en
.
--
You received this message because you are subscribed to the Google Groups
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.