11227 - The silver bullet.

All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
coolguy
New poster
Posts: 30
Joined: Tue Oct 17, 2006 5:59 pm

11227 - The silver bullet.

Post by coolguy »

I am getting WA in this problem. I am using O( n^2 logn ) algorithm for solving this problem. I use STL set to take care of the multiple instance of a set. Can anyone give me some tricky input output ? I use EPSILON = 1e-7 to check the equality of two doubles.

Please help me in this. If any one wants i can post the source code here ...
Thank you
COOLGUY >>>>>>>>>>>>>>>>>
In good company
coolguy
New poster
Posts: 30
Joined: Tue Oct 17, 2006 5:59 pm

Post by coolguy »

i found the bug..please ignore my previous post.
thank you
In good company
playerX
Learning poster
Posts: 63
Joined: Fri Apr 25, 2003 11:57 pm
Location: Coimbra, Portugal

Post by playerX »

I'm getting WA too, i'm sorting and removing duplicates in linear time, them applying the naive method of finding the maximum points in a line since N is small (<= 100), I'm using an epsilon of 1e-7 too, if someone can point common flaws or some input that'd be great.

Thanks in advance
EDIT nevermind, i was using abs instead of fabs :oops:
be cool...
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

Instead of using EPS, it's easier to just convert to integer
coordinates by multiplying by 100.
Post Reply

Return to “Volume 112 (11200-11299)”