## 10169 - Urn-ball Probabilities !

Moderator: Board moderators

lalesculiviu
New poster
Posts: 1
Joined: Sat Oct 13, 2001 2:00 am

### 10169 - Urn-ball Probabilities !

Carlos
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Contact:
Sorry, the judge's output was wrong. It will be fixed soon.

chang
New poster
Posts: 16
Joined: Wed Jan 16, 2002 2:00 am

### Test Cases needed

Hi...

Can anybody give me few test cases ? I need to check the outputs with mine.

Christophoros
New poster
Posts: 5
Joined: Thu Nov 25, 2004 12:56 am
is the the judge's output fixed ?

The problem seems very easy. I checked all my solutions with Mathematica and they are exactly the same. I can not understand how it comes WA.
I assumed that the input '0' is not legal. If it is this my mistake, what should be the output?

mimran
New poster
Posts: 3
Joined: Tue Feb 13, 2007 8:34 pm
Contact:

### 10169 - I need Help plzzz (Need code)

I tried it lot of times and i m unable to solve it, here is my code:
void main(void)
{
int n;
cout<<"How many times you pick up ?";
cin>>n;
long double result=1;
double turn=1.0;
for (int i=1;i<=n;i++)
{
result=result * ( (1/turn) * (1/(turn+1)) );
turn++;

}

cout<<result<<endl;

}

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan
I need help too. Could someone verify my io test ?
Input:

Code: Select all

``````10
100
1000
10000
100000
999999
``````
Output:

Code: Select all

``````0.675050 14
0.700373 317
0.703028 5138
0.703295 71322
0.703315 913151
0.700368 11131411
``````

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan
Found bug and got AC. The output of previous input should be:

Code: Select all

``````0.675050 14
0.700373 317
0.703028 5138
0.703295 71322
0.703322 913151
0.703325 11131411
``````

mimran
New poster
Posts: 3
Joined: Tue Feb 13, 2007 8:34 pm
Contact:

### Hi rio send me your code plz

Hi there, can you send me your code for this problem

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan
The input file contains several lines of inputs.
Your code only takes one case.
For each line of input print a single line of output containing a floating point number and an integer. The floating-point number indicates the probability that you have picked up two red balls in at least one of your pick-ups and the second integer denotes how many consecutive zeros are there after decimal point in the probability value that all of your pick ups has both balls as red.
Ouput exactly what is specified. And don't output what is not specified.

mimran
New poster
Posts: 3
Joined: Tue Feb 13, 2007 8:34 pm
Contact:
(Thanks rio ) I tried your input values, now i got write answer, but how to break exponential numbers in normal numbers and how to get number of zeroes after decimal point.