11409 - Ball Passing

All about problems in Volume 114. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh

11409 - Ball Passing

Post by emotional blind »

I am getting WA. Using DP, I am calculating p1 and p2, here
p1 = probability of first ball to reach desired location
p2 = probability of second ball to reach desired location

now the ouput is floor(p*1e9)
where p=p1+p2-p1*p2

am I wrong? any critical input?

Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11409 - Ball Passing

Post by brianfry713 »

That is correct.
To print the output I used

Code: Select all

#define EPS 1e-7
printf("%.0lf\n", floor(p*1e9+EPS)+EPS);
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 114 (11400-11499)”