ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1417. Space Poker 2

Precision problem
Posted by Samsonov Alex [USU] 11 Nov 2005 20:27
I've writtan the program and it seems that I use correct solution. But the output for the sample is:

0.32985
0.33622
0.33390

Extended in Pascal doesn't help.
Should we use some specific things?
Re: Precision problem
Posted by sgn 14 Dec 2005 19:42
I have WA on test 9 and I don't know why too :)
Re: Precision problem
0.32985
0.33622
0.33390
The sum of this number is not 1.
But I make next operations:
I write N-1 numbers as I find in program.
And the last number I write as subtraction 1 and N-1 previous numbers.

So I have WA2.

Can somebody explain me why?
Re: Precision problem
Posted by Alexander Prudaev 22 May 2006 18:08
992050/2971042=0,33390642071....
maybe use round(100000*x)/100000?
Re: Precision problem
Posted by Vedernikoff Sergey 30 Jun 2006 14:00
You can just output not 5 digits after decimal point, but more. I've outputted 8 digits - and AC in 1st attempt... My program finds not 5, but 10 exact digits after decimal point.

P. S. I've used not extended, but even REAL in Pascal...

P. P. S. And if my program outputs 5 digits - it's output corresponds to the sample output. So, may be your algo isn't right?

Edited by author 30.06.2006 14:03