this article is write by Erik
Well, after trying some new things again I finally got AC for this problem. Here are some things I found out which might be usefull:
- Input coordinates are all integers (so this problem is solvable in an exact way, no doubles required)
- Input coordinates are all non-negative
- Object names do not contain whitespace and aren't numbers
- maximum number of points per object is surely less than 100000
- Input contains objects where the given 'center of mass' really isn't the physical center of mass of the object
- Input does not contain objects where the center of mass is completely outside the convex hull of the object
- Input however does contain objects where the center of mass is ON the convex hull (and the object need not be made of only colinear points)
- For every input object there is at least one acceptable base line
- The baseline with minimal number, has a number greater than zero and smaller than 100
But these are all little things that shouldn't give too much problems. However (and this turned my WA into AC), the sentence
'when this line is horizontal, the centre of mass lies ... strictly between its endpoints'
should be interpreted as
- when this line is horizontal, the center of mass lies between its endpoints or precisely above one of its endpoints
I don't know about you guys, but in my opinion STRICTLY BETWEEN means really between, so endpoints excluded. This also makes more sense for the object to be able to stand stably....
Ow, and in order to get AC instead of PE the result of each object should be:
[NAMEJUSTIFIED][SPACE][NRJUSTIFIED][ENDOFLINE]
where NAMEJUSTIFIED must have length 19 and is left justified
and NRJUSTIFIED must have length 2 and is right justified
(this means that the sample outputs are wrong!)
for example:
Code:
Object2 6
SquareWithALongName 27
..........................................................................................
I think the most important thing is that .....................................
'when this line is horizontal, the centre of mass lies ... strictly between its endpoints'
should be interpreted as
- when this line is horizontal, the center of mass lies between its endpoints or precisely above one of its endpoints
where NAMEJUSTIFIED must have length 19 and is left justified
and NRJUSTIFIED must have length 2 and is right justified
(this means that the sample outputs are wrong!)
printf("%-19s %2d\n", names, minNum);
and if 'center of mass' On the edge , this is not the stable positions......
if you notice things above , i think you can get AC
