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

Samsonov Alex [USU] Precision problem [4] // Problem 1417. Space Poker 2 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?
sgn Re: Precision problem // Problem 1417. Space Poker 2 14 Dec 2005 19:42
I have WA on test 9 and I don't know why too :)
UXMRI: Sergey Baskakov, Raphail Akhmedisheff and Denis Nikonorov Re: Precision problem // Problem 1417. Space Poker 2 1 Mar 2006 00:40
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?
Alexander Prudaev Re: Precision problem [1] // Problem 1417. Space Poker 2 22 May 2006 18:08
992050/2971042=0,33390642071....
maybe use round(100000*x)/100000?
Vedernikoff Sergey Re: Precision problem // Problem 1417. Space Poker 2 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