|
|
back to boardIs something wrong with my algorithm? My algorithm is as follows: I consider planes that cut the sphere in half - they are determined by two points in the input and the center of the sphere. I split the input points in three sets according to this plane - points "above" the plane (say N1 points), points "under" the plane (say N2 points) and points in the plane (all of them being on one circle). Obviously at this moment these points on this circle are not visible since they aren't on the open emisphere, so I try to move this emisphere just a little to make the maximum number of points visible. To handle this, I find the maximum number of points P on some semi-circle. So I conclude that the maximum number of visible points using this plane is the maximum between N1+P and N2+P. Can you give me a case for which this algorithm is not correct? I get WA on test-case 7. Thanks. Re: Is something wrong with my algorithm? Your algorithm is correct. Re: Is something wrong with my algorithm? Try these tests: Input #1: 1 0 0 1 Output #1: 1 Input #2: 3 0 0 1 0 0 100 0 0 600 Output #2: 3 Re: Is something wrong with my algorithm? Test #2 is incorrect, isn't it? "There is not more than one plane at each point of the Earth's surface." |
|
|