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?
11409 - Ball Passing
Moderator: Board moderators
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11409 - Ball Passing
That is correct.
To print the output I used
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!