10509  R U Kidding Mr. Feynman?
Moderator: Board moderators
Q10509 Help~~~
* Sorry, since there's no forum for Vol CV, I'll just post it here *
Excuse me, I'm always getting WA in this qq.
So can anyone help me? Or have I misinterpreted the qq??
Should I try to expand (a + dx)^3 and just ignore the dx^2 and dx^3 terms? Or am I wrong? Plz tell!!
Some critical inputs/outputs would be nice too!!
Excuse me, I'm always getting WA in this qq.
So can anyone help me? Or have I misinterpreted the qq??
Should I try to expand (a + dx)^3 and just ignore the dx^2 and dx^3 terms? Or am I wrong? Plz tell!!
Some critical inputs/outputs would be nice too!!
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
10509  R U Kidding Mr. Feynman?
This problem really bothers me!! I didn't solve it during the contest and I still don't get it accepted. And it shouldn't be complicated, though...
Isn't it just
I tried around with different roundings... However, nothing helped.
I get exactly the sample outputs, so may someone publish some other test cases please?? Thanks a ton!!
Isn't it just
Code: Select all
a = floor(sqrt3(n));
return a+(na^3)/(3*a^2);
I get exactly the sample outputs, so may someone publish some other test cases please?? Thanks a ton!!
 the LAZBOy
 Learning poster
 Posts: 94
 Joined: Wed Jul 31, 2002 12:44 pm
 Location: Dacca, Bangladesh
 Contact:
Possibly precision error when calculating dx...
I'm sure I've got the exact integral value of a.
So, any help?? Thx in advance!
I'm sure I've got the exact integral value of a.
So, any help?? Thx in advance!
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
What about pascal?
I tried to solve the problem using double in Pascal with the same formula. I got WA. Any hints? For cubic root i used trunc(exp((1/3)*ln(n))). A tried with int instead of trunc, too. Help please.
God is dead  Nietzsche
Nietzsche is dead  God
Nietzsche is dead  God
Disputed
This problem is definitely disputed.
from initial eq. n^1/3=a+dx
we get, n=a^3 + 3a^2(dx)+3a(dx)^2+ (dx)^3
here we should ingnore 3a(dx)^2 AND (dx)^3,
one thing that bothers me is why is it valid to ignore 3a(dx)^2,
there is a leading coefficient of 3a, it is numerically invalid to ignore this term. I think the judge should have considered that.
from initial eq. n^1/3=a+dx
we get, n=a^3 + 3a^2(dx)+3a(dx)^2+ (dx)^3
here we should ingnore 3a(dx)^2 AND (dx)^3,
one thing that bothers me is why is it valid to ignore 3a(dx)^2,
there is a leading coefficient of 3a, it is numerically invalid to ignore this term. I think the judge should have considered that.
Thx! By writing my code again, I've got an ACC finally... However, I still don't understand why I got WA before...
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
This problem askes you to calculate the cubic root USING THE EXPLAINED approxximation method. It is valid to ignore (dx)^2, because the dr. did it, when calculating. On the other hand i don't understand what happened to the judge program not accepting solutions with long double. Anyone using Pascal please post his solution, because i don't have a clue how can it be solved to be accepted. That gave me nerves during the contest. You can see my solution two posts above.
God is dead  Nietzsche
Nietzsche is dead  God
Nietzsche is dead  God

 Experienced poster
 Posts: 131
 Joined: Thu Apr 17, 2003 8:39 am
 Location: Baku, Azerbaijan
10509  R U Kidding Mr. Feynman?
Hello.
I get WA.
I use the formula
n=a^3+3*a^2*dx+3*a*dx^2+dx^3
I ignore dx^3.
Then
na^3=3*a*(a*dx+dx^2)
(na^3)/(3*a)=a*dx+dx^2
I ignore dx^2 here too
and at last I get
(na^3)/(3*a^2)=dx
Is it wrong or right. And why do I get WA?
Thanks.
I get WA.
I use the formula
n=a^3+3*a^2*dx+3*a*dx^2+dx^3
I ignore dx^3.
Then
na^3=3*a*(a*dx+dx^2)
(na^3)/(3*a)=a*dx+dx^2
I ignore dx^2 here too
and at last I get
(na^3)/(3*a^2)=dx
Is it wrong or right. And why do I get WA?
Thanks.
_____________
NO sigNature
NO sigNature
 Pier
 New poster
 Posts: 38
 Joined: Thu Mar 27, 2003 9:12 pm
 Location: Aguascalientes, Mexico
 Contact:
I don't like the judge!
This is stupid!
If I use:
[pascal] writeln(output,(a+dx):0:4);[/pascal]
I get WA, but if I use
[pascal] a:= a+dx;
writeln(output,a:0:4);[/pascal]
I get AC!
If I use:
[pascal] writeln(output,(a+dx):0:4);[/pascal]
I get WA, but if I use
[pascal] a:= a+dx;
writeln(output,a:0:4);[/pascal]
I get AC!
There are 10 kind of people on this world: those who understand binary and those who don't!