You are not logged in. Please login at www.codechef.com to post your questions!

×

Chef and An Ideal Problem Dec 2018 Editorial (Unofficial)

Monty Hall Problem suggests that when a person swaps the doors after knowing the location of goat in one of the two doors. The probability of getting a car in the swapped door is 66%, increased from the previous 33%. Solution---
So, we can randomly choose the initial door and accordingly swap the doors. It's a very naive approach but works.
My solution

This question is marked "community wiki".

asked 15 Jan, 16:46

sk22's gravatar image

2★sk22
0
accept rate: 0%

wikified 15 Jan, 16:48


Your soln is wrong.
It has 50% probability of failing.
If x=1 and y=2 or x=2 and y=1 you will get WA. If x=3 and y=2 you code will not print z.

link

answered 15 Jan, 16:58

aryanc403's gravatar image

5★aryanc403
2.7k1618
accept rate: 10%

I completely agree with your answer, but maybe test cases were too weak.

(15 Jan, 20:54) sk222★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×427
×252
×152
×46
×4

question asked: 15 Jan, 16:46

question was seen: 96 times

last updated: 15 Jan, 20:54