Page 1 of 1

10002 center of masses

Posted: Wed Jan 03, 2007 2:04 pm
by david
I think judge's input is flawed. I'm pretty sure my solution is correct, but I always get WA, and browsing through the forums shows that only people who compute the convex hull first get AC, but this shouldn't be necessary as the problem description says the polygon is convex (so one should only need to sort the points by angle). Thus I think the judge data cointains concave polygons.

Posted: Wed Jan 03, 2007 2:24 pm
by Carlos
mail us your code and we'll check it.

Posted: Wed Jan 03, 2007 7:41 pm
by Adrian Kuegel
Note that the points of the convex polygon can be given in any order, so if you want to find the center of masses you have to determine the correct order of the points first (this can be done by calculating the convex hull, although actually you need only the sorting step of a graham scan).