10169 - Urn-ball Probabilities !

All about problems in Volume 101. 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
lalesculiviu
New poster
Posts: 1
Joined: Sat Oct 13, 2001 2:00 am

10169 - Urn-ball Probabilities !

Post by lalesculiviu »

To admins: can you please help me and tell me a test where my program fails? Or only some big test?

Carlos
System administrator
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain
Contact:

Post by Carlos »

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

Post by chang »

Hi...

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

Thankx in advance..

Christophoros
New poster
Posts: 5
Joined: Thu Nov 25, 2004 12:56 am

Post by Christophoros »

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?

Thx in advance for any reply.

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

10169 - I need Help plzzz (Need code)

Post by mimran »

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

Post by rio »

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
Thanks in advance.

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio »

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

Post by mimran »

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

Post by rio »

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:

Post by mimran »

(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.

Post Reply

Return to “Volume 101 (10100-10199)”