10678 - The Grazing Cow
Moderator: Board moderators
-
- New poster
- Posts: 13
- Joined: Fri Nov 03, 2006 2:53 pm
- Location: bangladesh
- Contact:
10678 - The Grazing Cow
Hi everyone
I know its a very easy problem. it seems ellipse to me . I also know the area of ellipse is pi*a*b.
I know 'a' but how could I get 'b'. plz some one help me.
I know its a very easy problem. it seems ellipse to me . I also know the area of ellipse is pi*a*b.
I know 'a' but how could I get 'b'. plz some one help me.
-
- New poster
- Posts: 13
- Joined: Fri Nov 03, 2006 2:53 pm
- Location: bangladesh
- Contact:
See the image below...
L and D are given, you have to find b.
Code: Select all
Spoiler Removed...
Last edited by Jan on Mon Jan 29, 2007 10:53 am, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage
HomePage
-
- New poster
- Posts: 13
- Joined: Fri Nov 03, 2006 2:53 pm
- Location: bangladesh
- Contact:
-
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
WHY WA
WHY WA
![:cry:](./images/smilies/icon_cry.gif)
Code: Select all
NO need to see it again
Last edited by Debashis Maitra on Sat Dec 23, 2006 9:33 pm, edited 2 times in total.
Akash chhoyar swopno
Dream to touch the sky
Dream to touch the sky
Re: WHY WA
In your code, 5 / 2 is 2 not 2.5 because 'int' doesn't keep floating point..Debashis Maitra wrote:WHY WA![]()
Code: Select all
CUT
Last edited by helloneo on Sun Dec 24, 2006 5:12 am, edited 1 time in total.
-
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
WA...
Some one please help me.... It seems that WA is fixed for me.... I can't do anything....
Code: Select all
Code Removed
}
Last edited by Obaida on Sat Mar 08, 2008 11:49 am, edited 1 time in total.
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.
use
Hope it helps.
Code: Select all
const double pi = 2*aocs(0.0);
Re: 10678 - The Grazing Cow
Can anyone please give me any suggestion about why I am getting WA?My code is given below:-
Code: Select all
#include<stdio.h>
#include<math.h>
int main(void)
{
double a,b,l,d,pi=2*acos(0);
int n;
scanf("%d",&n);
for(;n;n--)
{
scanf("%lf%lf",&d,&l);
a=l/2;
b=(double)sqrtl((l/2*l/2)-(d/2*d/2));
printf("%.3lf\n",pi*a*b);
}
return 0;
}
Re: 10678 - The Grazing Cow
Replace the following part of your code:
with:
And remove your code after acc. ![:)](./images/smilies/icon_smile.gif)
Code: Select all
sqrtl((l/2*l/2)-(d/2*d/2));
Code: Select all
sqrtl(((l/2)*(l/2))-((d/2)*(d/2)))
![:)](./images/smilies/icon_smile.gif)
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.
Re: 10678 - The Grazing Cow
I have changed according to your suggestion,but I am still getting WA
.Is there any special cases which I haven't considered.Can you give me some inputs to check?
Thanks for helping me out![:)](./images/smilies/icon_smile.gif)
![:(](./images/smilies/icon_frown.gif)
Thanks for helping me out
![:)](./images/smilies/icon_smile.gif)
Re: 10678 - The Grazing Cow
remove the double before sqrtl.... hope you will get acc. ![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.