Re: [algogeeks] Re: Circle Circle & more Circles .........

2011-07-20 Thread Pankaj
http://www.codechef.com/FEB10/problems/M5/ On Wed, Jul 20, 2011 at 5:35 PM, Piyush Sinha wrote: > @Dumanshu..i am not partitioning them into just two queues... > > Moreover I just gave a raw idea...and yeah the complexity is in the order > of n^2 only. > There are many chances of improvement

Re: [algogeeks] Re: Circle Circle & more Circles .........

2011-07-20 Thread Piyush Sinha
@Dumanshu..i am not partitioning them into just two queues... Moreover I just gave a raw idea...and yeah the complexity is in the order of n^2 only. There are many chances of improvement in it.. On Wed, Jul 20, 2011 at 5:30 PM, Dumanshu wrote: > @Piyush: > Initially for partitioning the giv

[algogeeks] Re: Circle Circle & more Circles .........

2011-07-20 Thread Dumanshu
@Piyush: Initially for partitioning the given circles into the 2 queues u r having an O(n^2) loop, so u are comparing each circle with every other. Now, it is possible that u have 3 or more circles A,B,C intersecting if i got ur algo correct, ur intersection queue will have AB, BC, CA. So, accordin

Re: [algogeeks] Re: Circle Circle & more Circles .........

2011-07-20 Thread Piyush Sinha
I would like to redefine my algo with cases clarified... Create a queue that is made to contain the points... say points queue [1000]; for i:1 to n for j:i+1 to n Calculate d (distance between the two centers) if (d >= r0 + r1) keep them in two separate queues //the circles don't inte

[algogeeks] Re: Circle Circle & more Circles .........

2011-07-20 Thread SAMMM
I doubth . For (d< r0 + r1) ignore the point with smaller radius as it will overshadowed the bigger circle completely There may be a case where the circle is partially overlapped by the other circles. Then this algo will fail . The area will be of like these :- Suppose 3 circles are there X,Y&Z

Re: [algogeeks] Re: Circle Circle & more Circles .........

2011-07-19 Thread Saket Choudhary
^The condition if d < r0+r1 means the circles are intersecting hence theres no way a bigger circle will overshadow the smaller circle which will happen only whne d < abs(r1-r0) On 20 July 2011 00:00, Piyush Sinha wrote: > Just a simple thoughtI am assuming all points are unique > > Creat

Re: [algogeeks] Re: Circle Circle & more Circles .........

2011-07-19 Thread Piyush Sinha
Just a simple thoughtI am assuming all points are unique Create a queue that is made to contain the points... say points queue [1000]; for i:1 to n for j:i+1 to n Calculate d (distance between the two centers) if (d >= r0 + r1) keep them in two separate queues if(d<

[algogeeks] Re: Circle Circle & more Circles .........

2011-07-19 Thread SAMMM
See the input will be :- 6< No of circles x1 y1 R1 x2 y2 R2 x3 y3 R3 x4 y4 R4 x5 y5 R5 x6 y6 R6 Output:- Area occupied by the above circles (one line) 4 decimal points . On Jul 19, 9:01 pm, priyanka goel wrote: > can u pl tell wat is dis x & y coordinate? > are dey centre coordinates or a