## 11112 - Babylonian Roulette

Moderator: Board moderators

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:

### 11112 - Babylonian Roulette

For some reason I keep getting WA. Maybe I misunderstood the problem.
Here's my code (a=pot at beginning b = bet, c = pot at the end)

Code: Select all

``````AC...
``````
Last edited by sclo on Mon Oct 09, 2006 1:03 am, edited 1 time in total.

david
Learning poster
Posts: 83
Joined: Mon Apr 21, 2003 10:14 pm
You are assuming that at at least one player must turn the roulette, but this isn't so. (Zero is a valid answer).

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:
david wrote:You are assuming that at at least one player must turn the roulette, but this isn't so. (Zero is a valid answer).
Now I got AC, but my assumptions contradicts the problem statements.
In other case, the printed answer is one positive integer number telling the minimal number of players that could turn the roulette for the day corresponding to the annotations.
Also another assumption that I have to make is that P0<bet is valid. It is not clear from the problem statement whether this case is valid or not.
If at some turn the pot was less than the bet, the game was ended for that day
It should be "If P(t+1) < bet then the game ends...."

kgrant
New poster
Posts: 3
Joined: Tue Apr 10, 2007 9:56 pm
Hi I think I have also misunderstood the question... I keep getting WA

Code: Select all

``````AC
``````
Any ideas what tricky cases I am getting wrong?

Edit: I misunderstood last rule of the game..
Last edited by kgrant on Thu Apr 12, 2007 12:20 am, edited 1 time in total.

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Contact:

Input:

Code: Select all

``````104 475 579
0 0 0``````
Output:

Code: Select all

``1``
Hope it helps.
Ami ekhono shopno dekhi...
HomePage

kgrant
New poster
Posts: 3
Joined: Tue Apr 10, 2007 9:56 pm
Thank you Jan. I get AC now.

I misunderstood Simon's comment regarding the rule
If at some turn the pot was less than the bet, the game was ended for that day

annhy
New poster
Posts: 40
Joined: Sun May 27, 2007 1:42 am
Location: Taiwan

### Re: 11112 - Babylonian Roulette

I don't like this kind of problem.

Since my English is poor, I spent more than 40 minutes for reading and understanding the article. After I understood this problem, I spent only about 4 minutes to coding and submit. I think this problem is suitable for the "English reading contest" rather than the "programming contest".