## 10811 - Up the Ante

Moderator: Board moderators

Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong
After getting several WA, I couldn't resist to get the offcial data from Waterloo. I found that I failed in a case in the offical data with house limit equals 1, while the problem states that the house limit is at least 2.

abishek
Experienced poster
Posts: 131
Joined: Mon Dec 15, 2003 5:41 am
I am confused with some probability here. Will stan continue to play after scoring a positive score in the kth round or higher rounds?

if we call stan's score A
isnt the answer to the question

Prob(A>0 after k rounds) + prob(A<= 0 in the kth round) * prob (A>0 in the k+1 th round) +
prob(A<=0 in the kth and (k+1)th round) * prob(A>0 in the k+2 th round) ... uptill the mth round.

but I don't seem to get the sample input

Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong
abishek wrote:I am confused with some probability here. Will stan continue to play after scoring a positive score in the kth round or higher rounds?
He will stop playing once he gets his first positive net score after playing k rounds and before the m+1 rounds.
abishek wrote:if we call stan's score A
isnt the answer to the question

Prob(A>0 after k rounds) + prob(A<= 0 in the kth round) * prob (A>0 in the k+1 th round) +
prob(A<=0 in the kth and (k+1)th round) * prob(A>0 in the k+2 th round) ... uptill the mth round.
Did you deal with the conditional probability? I mean your formula should be modified as:
Prob(A>0 in the kth round) +
prob(A<=0 in the kth round) * prob (A>0 in the k+1 th round | A<=0 in the kth round) + ...

tRipper
New poster
Posts: 22
Joined: Sun Mar 13, 2005 5:04 pm
Location: out there
Can someone tell me the correct output for this input?

Code: Select all

``````INPUT:

5
3 4 10
1 30 1000
29 30 1000
10 11 50
1 2 2
``````
My program outputs:

Code: Select all

``````OUTPUT:

0.5835
0.9664
0.7483
0.6271
0.4898
``````
Which gives me a WA..

misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm
tRipper wrote:Can someone tell me the correct output for this input?
My AC program outputs:

Code: Select all

``````0.5835
0.9659
0.7298
0.6044
0.4898
``````

tRipper
New poster
Posts: 22
Joined: Sun Mar 13, 2005 5:04 pm
Location: out there
Thanx misof, i found my bug. AC now...