10209 - Is This Integration ?

Moderator: Board moderators

Learning poster
Posts: 90
Joined: Mon Feb 16, 2004 8:53 pm
Location: Bangalore INDIA
use long double instead of float
if u can think of it .. u can do it in software.

Ghust_omega
Experienced poster
Posts: 115
Joined: Tue Apr 06, 2004 7:04 pm
Location: Venezuela
Hi newcrama , your method is good , the only thing that you have to do is change 3 by 3.0 or 4 by 4.0 and o by 0.0 when you use double and integer is better use 4.0 instead of 4. I modified this in your code and get AC see your PM for see the code change

willima
New poster
Posts: 13
Joined: Wed Dec 07, 2005 1:19 pm
Location: Brazil

Why the formula?

Could any good "soul" explain me how I can reache this formulas? I tried so much to include/exclude simple geometric shapes in order to get the answer but I couldn't!

"Don't let the day go by
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"

albet_januar
New poster
Posts: 35
Joined: Wed Apr 12, 2006 6:03 pm
Location: jakarta, indonesia
Contact:
can anybody explain me how to get the formula?
i really confuse bout this one..

THx..
GBU..

ferrizzi
New poster
Posts: 23
Joined: Thu Mar 30, 2006 5:42 pm
Location: Brazil
I tried to get the equations above but I coudn't. I get 2 equations with 3 variables and I can't find the third one, to solve the system. So, I tried to integrate the equation sqrt(a^2 - x^2) + a, in the range (0, a/2), in order to get half of the square-lined area. After this integration, the formula that I get is: (a^2 * sqrt(3.0))/8.0 + (a^2 * asin(0.5) )/2.0 + (a^3)/8.0 . So I multiply this result by 2.0 and get the answer of the square-lined area. But this answer doens't work. Could anybody help me with this problem?

Thank you very much!
Regards,
[]'s
Andre

tgoulart
New poster
Posts: 42
Joined: Sat Oct 21, 2006 8:37 am
Location: Alegrete, Brazil
Since there are codes for this problem on the board, I guess I'm not giving too much with this post, so these are the areas I used to find the formulas.

http://www.ee.furg.br/~thiago/10209.jpg
Thiago Sonego Goulart - UFMG/Brazil

ferrizzi
New poster
Posts: 23
Joined: Thu Mar 30, 2006 5:42 pm
Location: Brazil
Thank you tgoulart!
I got AC today! =D I was misusing the integral. I saw yor third figure and I figured out my error. With your third picture I got te third equation.
I'll explain how I solve this problem, since the equations given in previous codes in this forum are too hard to understand. Let's call x, y and z the pieces of the figure. So, we got the equations:

4x + y + 4z = a * a = square area
x + 2z = a*a - (PI * a * a)/4.0 = square area - 1/4 of the circle area
and the third one, the more complicated to get:
2x + 0.5y + 1.5z = integral( a^2 - sqrt(a^2 - x^2) ) in the range [0,a/2]

(try to visualize the equations above in the figure. The figures posted by tgoulart show them)

The integral is easy to find in some book and also in the internet. If someone get stuck in this part, post here and I explain how to solve the integral.

We now have 3 equations and 3 variables, so it is easy to solve using Cramer's Rule. After finding D, Dx, Dy, Dz, the answer to this problem is given by: (Dy/D, 4.0*(Dx/D), 4.0*(Dz/D)) respectively.
Regards,
[]'s
Andre

bonny
New poster
Posts: 3
Joined: Thu Aug 30, 2007 12:31 pm
Location: Dhaka
no need to integrate

3rd eqn: 2x+y+z=(pi/3 - sqrt(3)/4)a^2

try calculating the intersecting parts of 2 circles.

himanshu
New poster
Posts: 17
Joined: Mon May 15, 2006 12:24 pm
Contact:

10209 TLE!

Could you please tell me why this gives me TLE

Code: Select all

``````#include<stdio.h>

int main()
{
//snipped
while(scanf("%lf", &r))
{
//snipped
}
}``````
Last edited by himanshu on Fri Oct 19, 2007 12:58 pm, edited 1 time in total.

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea
scanf() returns EOF not 0 at the end of file..

Remove your code if you get AC..

himanshu
New poster
Posts: 17
Joined: Mon May 15, 2006 12:24 pm
Contact:

Thanks

It worked!

apurba
New poster
Posts: 42
Joined: Sun Oct 07, 2007 10:29 pm

is this real?

bonny wrote:no need to integrate

3rd eqn: 2x+y+z=(pi/3 - sqrt(3)/4)a^2

try calculating the intersecting parts of 2 circles.

i have tried all my geometrical knowledge to figure that out.....
but i can't.

bonny or anyone else.........pls explain this...........

thanks and keep posting..........

Code: Select all

``keep dreaming...``

fR0D
New poster
Posts: 29
Joined: Mon Feb 11, 2008 5:59 am
Contact:

y m i getting WA

here's my code
can sum1 help

Code: Select all

``````Code Deleted after AC
``````
Last edited by fR0D on Mon Feb 25, 2008 8:22 pm, edited 1 time in total.

tgoulart
New poster
Posts: 42
Joined: Sat Oct 21, 2006 8:37 am
Location: Alegrete, Brazil

Re: y m i getting WA

fR0D wrote:here's my code
can sum1 help

Code: Select all

``````REMOVED
``````
I don't know if your expressions are right, but you'd better use double instead of float for real type.
Last edited by tgoulart on Mon Feb 25, 2008 11:05 pm, edited 1 time in total.
Thiago Sonego Goulart - UFMG/Brazil

fR0D
New poster
Posts: 29
Joined: Mon Feb 11, 2008 5:59 am
Contact:
thnx vry much...it worked...it will b gud if u remove the code too...