11112 - Babylonian Roulette

All about problems in Volume 111. 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
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

11112 - Babylonian Roulette

Post by sclo » Sun Oct 08, 2006 9:48 pm

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

Post by david » Sun Oct 08, 2006 11:44 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
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Mon Oct 09, 2006 1:00 am

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

Post by kgrant » Tue Apr 10, 2007 10:01 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
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Wed Apr 11, 2007 11:21 pm

How about this case...

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

Post by kgrant » Thu Apr 12, 2007 12:18 am

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

Post by annhy » Sat Aug 14, 2010 5:16 am

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

Post Reply

Return to “Volume 111 (11100-11199)”