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- wrote:
> Em sábado, 27 de
Em sábado, 27 de abril de 2013 21h53min06s UTC-3, alv-r- escreveu:
> For the first circle, you need pi*(r+1)²-pi*r², which is pi*((r+1)² - r²)
> cm², since 1 mililiter covers pi cm², you need (r+1)²-r² paint.
>
>
>
> following this logic, for each circle you need:
>
> 1st: (r+1)² - (r-0)²
>
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
wrote:
> 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 nec
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 wrote:
> the 1.5 might just be to speed up the process to get the value. even if
> 1
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 i
The result of that formula is very large, so there is a possibility
that it will not fit into a 64-bit integer.
The first comparison uses 'double' type to check if this number is too
large. If it is, it is certainly bigger than t. If it is not, more
precise integer computations can be used (second
For the first circle, you need pi*(r+1)²-pi*r², which is pi*((r+1)² - r²) cm²,
since 1 mililiter covers pi cm², you need (r+1)²-r² paint.
following this logic, for each circle you need:
1st: (r+1)² - (r-0)²
2nd: (r+3)² - (r-2)²
3rd: (r+5)² - (r-4)²
4th: (r+7)² - (r-6)²
and so on...
note the rela
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 total
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 goo
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 wrote:
> Hi,
>
> I understand th
Hi,
I understand that they're using binary search, but I don't know how can it get
to the solution.
Could someone be very nice and explain the code below, please?
This is from coder "wata":
void solve() {
long left = 0, right = 1L << 40;
while (right - left > 1) {
11 matches
Mail list logo