Re: [gcj] Re: Bull's Eye - Large

2013-04-30 Thread Madura Anushanga
I did not actually compete in the competition(I slept thru it) but came up with this answer which is O(1) per case in python http://0xdeafc0de.wordpress.com/2013/04/30/gcj-2013-r1a-bullseye-o1-solution/ - Madura A. On Sun, Apr 28, 2013 at 10:23 PM, alv-r- alvaro.br...@gmail.com

Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Vaibhav Tulsyan
I dont understad it either. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to

Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Rajendra Joshi
Area of the first white circle is pi* r*r Area of first black circle that includes first white circle is pi * (r+1) * (r+1) So area of first black strip is pi * (r+1) * (r+1) - pi *r *r If you continue doing this then area of second black strip is pi * (r+3) * (r+3) - pi * (r+2) * (r+2) So

Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Samuel Jawahar
int a=2*r+1; int d=4; double d=-(2*a-d)+Math.sqrt((2*a-d)*(2*a-d)+8*d*k); int dinominator=2*d; int result=d/dinominator; answer is result On Sun, Apr 28, 2013 at 7:35 AM, bas 366a...@gmail.com wrote: The result of that formula is very large, so there is a possibility that it will not fit into

Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Leandro Coutinho
Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't work. I also tested the code without the first condition, but it's necessary to make it work. On Sat, Apr 27, 2013 at 4:42 PM, Kannappan deshka...@gmail.com wrote: the 1.5 might just be to speed up the process to get the

Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Leandro Coutinho
Thank you Bas and Samuel. Thanks a lot Raj and Álvaro. Now I understand the formula. =) On Sun, Apr 28, 2013 at 7:08 PM, Leandro Coutinho lescoutinh...@gmail.comwrote: Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't work. I also tested the code without the first

Re: [gcj] Re: Bull's Eye - Large

2013-04-27 Thread Kannappan
the 1.5 might just be to speed up the process to get the value. even if 1.6 was used or 1.55 was used for that matter, you might still get the right answer but with varying speeds. thats just my guess. haven't tried it. On Sat, Apr 27, 2013 at 6:04 PM, newbie007 lescoutinh...@gmail.com wrote: