10491 - Cows and Cars
Moderator: Board moderators
-
- Experienced poster
- Posts: 187
- Joined: Wed Dec 11, 2002 2:03 pm
- Location: Mount Papandayan, Garut
10491 - Cows and Cars
how to solve this problem? looks easy but i didnt get it.
Kalo mau kaya, buat apa sekolah?
-
- Experienced poster
- Posts: 192
- Joined: Sat Nov 30, 2002 5:14 am
-
- Experienced poster
- Posts: 187
- Joined: Wed Dec 11, 2002 2:03 pm
- Location: Mount Papandayan, Garut
Yes, look easy but very annoying me. e.g for input 2 1 1. there are 3 doors, which two of them contains cows. so first the probability of getting cars is 1/3. then a door which contained cow opened. here i saw that probability of getting car if i change the choice is 0.5. since i know there is only one car and one cow, it's fifty fifty. or my analysis is wrong? ![:-?](./images/smilies/icon_confused.gif)
![:-?](./images/smilies/icon_confused.gif)
Kalo mau kaya, buat apa sekolah?
-
- Experienced poster
- Posts: 187
- Joined: Wed Dec 11, 2002 2:03 pm
- Location: Mount Papandayan, Garut
Re: 10491 - Cows and Cars
i do a mistake S0 PLS ,
i wanna specify that all shows are done at a single time
NOTTTT one by oneeee okkkk
S0 THIS IS EASY QUESTION DONT THINK DIFFERENT TAKE IT EASY
i wanna specify that all shows are done at a single time
NOTTTT one by oneeee okkkk
S0 THIS IS EASY QUESTION DONT THINK DIFFERENT TAKE IT EASY
-
- Learning poster
- Posts: 83
- Joined: Wed Feb 01, 2006 12:59 pm
- Location: (Fci-cu) Egypt
- Contact:
Re: 10491 - Cows and Cars
I still can not figure out how to solve it. Can any one gives more explanation.
Sleep enough after death, it is the time to work.
Mostafa Saad
Mostafa Saad
Re: 10491 - Cows and Cars
Consider these 2 scenarios:
(1) Cow was initially chosen, then a Car was chosen after doors are revealed
(2) Car was initially chosen, then a Car was chosen after doors are revealed
The result is the sum of their probabilities.
(1) Cow was initially chosen, then a Car was chosen after doors are revealed
(2) Car was initially chosen, then a Car was chosen after doors are revealed
The result is the sum of their probabilities.
-
- New poster
- Posts: 14
- Joined: Wed Oct 21, 2009 11:04 am
Re: 10491 - Cows and Cars
whats the problem in my code..its giving me WA ...is tht scanf line is correct????
Last edited by codeworrior on Wed Oct 28, 2009 12:00 pm, edited 1 time in total.
Re: 10491 - Cows and Cars
@codeworrior:
try double data type instead of float. . .and it should work. . .
try double data type instead of float. . .and it should work. . .
-
- New poster
- Posts: 14
- Joined: Wed Oct 21, 2009 11:04 am
Re: 10491 - Cows and Cars
thnx buddy...done now..bt wats d problem with float ..i think i was within range and precision was also ok...
Re: 10491 - Cows and Cars
Ok, simply I can quote Shahriar Manzoor, "It is always a good idea to use double instead of float because double gives higher precision and range.Sometimes it is specified in the problem statement to use float type. In those cases, use floats."
Re: 10491 - Cows and Cars
@Codeworrior: As u are done by now, plz remove your code as early as possilbe. . .thnx
-
- Learning poster
- Posts: 72
- Joined: Tue May 30, 2006 5:57 pm
- Location: bangladesh
Re: 10491 - Cows and Cars
!!!!!!!!!!!!!!!!!!
With adding eps=1e-8 gave me WA.
With discarding this eps I got AC.
Surprise.
With adding eps=1e-8 gave me WA.
With discarding this eps I got AC.
Surprise.
Mak
Help me PLZ!!
Help me PLZ!!
-
- Experienced poster
- Posts: 147
- Joined: Mon Jun 07, 2010 11:43 am
- Location: University Of Dhaka,Bangladesh
- Contact:
Re: 10491 - Cows and Cars
You dont need eps.
input:
output:
best of luck!
input:
Code: Select all
100 100 12
10 10 9
5 5 2
1 1 0
34 64 24
Code: Select all
0.53209
0.95000
0.64286
0.50000
0.86777
UVa stats: http://felix-halim.net/uva/hunting.php?id=63448
My blog on programming: http://www.shafaetsplanet.com/planetcoding/
My blog on programming: http://www.shafaetsplanet.com/planetcoding/