|
|
back to boardCan someone give me any tips for test #11 pls First I thought it was precision but now I don't know anymore. I thought i would never post a thread like this one but... Can someone give me any tips for test #11 pls this is a part of my code, f_x() is P(x): left1 = left2 = f_x(0); for(x = 1e-3 ; x < 6000 ; x += 1e-3) { y1 = f_x(+ x); y2 = f_x(- x); ans += ((((left1 + y1)/left1)/y1)) + ((((y2 + left2)/y2)/left2)); left1 = y1; left2 = y2; } ans *= 0.5*(1e-3); Re: Can someone give me any tips for test #11 pls Try to use dx and limits which can be represented in binary form exactly (e.g. 1/1024.0 instead of 1e-3) Re: Can someone give me any tips for test #11 pls appreciate the tip, but still WA11... Re: Can someone give me any tips for test #11 pls Why are you using plus-minus 6000 as limits? 1/P(x) could have its maximum as far as x = 10^6 and a bit further. Edited by author 06.12.2008 22:36 Re: Can someone give me any tips for test #11 pls nvm, Accepted! Edited by author 02.06.2009 14:16 Re: Can someone give me any tips for test #11 pls Thank you a lot, I AC!!!!!!!!!!!!!! |
|
|