Weird Floating Point Behaviour in #730 Div. 2's Problem C (Need for Pink Slips)?

Revision en2, by GrizzlyGunner, 2021-07-09 12:00:36

Doubt in #730 Div. 2's Problem C (Need for Pink Slips):
Can someone please explain why 1e-10 works in the below line of a solution to Problem C, but 1e-9 doesn't?
Shouldn't they both work?

if(p * level * prob <= 1e-9) return;

The submissions: 1e-9, 1e-10.
Thanks.

Tags floating-point, epsilon, implementation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English GrizzlyGunner 2021-07-09 12:00:36 39 Tiny change: 'they both be working?\n\n~~~~~' -> 'they both work?\n\n~~~~~'
en1 English GrizzlyGunner 2021-07-09 06:44:33 487 Initial revision (published)