10209 - Is This Integration ?

All about problems in Volume 102. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

jagadish
Learning poster
Posts: 90
Joined: Mon Feb 16, 2004 8:53 pm
Location: Bangalore INDIA

Post by jagadish » Sun Sep 05, 2004 6:22 am

use long double instead of float
if u can think of it .. u can do it in software.

User avatar
Ghust_omega
Experienced poster
Posts: 115
Joined: Tue Apr 06, 2004 7:04 pm
Location: Venezuela

Post by Ghust_omega » Sun Sep 05, 2004 8:02 am

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

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

Why the formula?

Post by willima » Wed Aug 30, 2006 10:04 pm

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! :oops: :(

Thanks in advance!
"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:

Post by albet_januar » Sat Jan 13, 2007 12:11 pm

can anybody explain me how to get the formula?
i really confuse bout this one..

THx..
GBU.. :cry:

User avatar
ferrizzi
New poster
Posts: 23
Joined: Thu Mar 30, 2006 5:42 pm
Location: Brazil

Post by ferrizzi » Thu Aug 02, 2007 2:59 pm

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

Post by tgoulart » Fri Aug 03, 2007 5:45 am

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

User avatar
ferrizzi
New poster
Posts: 23
Joined: Thu Mar 30, 2006 5:42 pm
Location: Brazil

Post by ferrizzi » Sat Aug 04, 2007 1:27 am

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

Post by bonny » Thu Aug 30, 2007 12:51 pm

no need to integrate :D

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
Location: Hyderabad, India
Contact:

10209 TLE!

Post by himanshu » Fri Oct 19, 2007 11:56 am

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

Post by helloneo » Fri Oct 19, 2007 12:12 pm

Your program doesn't end..
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
Location: Hyderabad, India
Contact:

Thanks

Post by himanshu » Fri Oct 19, 2007 1:02 pm

It worked!

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

is this real?

Post by apurba » Fri Jan 11, 2008 6:50 pm

bonny wrote:no need to integrate :D

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

Post by fR0D » Tue Feb 19, 2008 12:17 am

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

Post by tgoulart » Tue Feb 19, 2008 3:28 am

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:

Post by fR0D » Mon Feb 25, 2008 8:24 pm

thnx vry much...it worked...it will b gud if u remove the code too...

Post Reply

Return to “Volume 102 (10200-10299)”