if unmalt[3]==0 means no unmalted flavour 3 is requested ,if it is
unmalt[3]>0 then it is Unmalted
In short i am doing as below
*case1:no customer requested requested single choice*
In this case all unmlted flavours can full fill the all
customers,since customer ca not request more then one malted
flavour
*case2:some customers have single choices*
In this case i will first consider customers who are having single
choice
ex:1(one test case)
3(flavours)
3(customers)
1 1 1
1 2 1
3 3 1 2 0 1 0
After processing the customer choices{moving the malted to lost}
1 1 1
1 2 1
3 2 0 1 0 3 1
Now find out customers who are having single choices
both are malted so the matl[1]=1,and malt[2]=1 unmalt[1]=0,unmalt[2]=0
the main purpose of malt and unmalt aray is to find out how meny malted and
unmalted flavoirs choices customers have
Now from the step 4,malt[3]=0 and unmalt[3]=0
and it malted so it increments the malt[3],if it is unmalt it will not
incremented
On Sat, Apr 7, 2012 at 7:24 PM, Luke Pebody <[email protected]> wrote:
> Step 4. You have a customer who can be satisfied by flavour 3 malted, and
> you have no evidence that flavour 3 has to be unmalted yet, so you decide
> to make flavour 3 malted. However, this may turn out to be the wrong choice.
>
> For example:
> Customer A: Malted 3 or Unmalted 4
> Customer B: Unmalted 3 or Unmalted 4
> Customer C: Unmalted 3 or Malted 4.
>
> Your solution would, if I understand it correctly, set 3 to Malted for
> customer A, set 4 to Unmalted for customer B and then be left floundering
> on the rock for customer C, and so say "IMPOSSIBLE". There is a solution
> though - just throw the malt away.
>
>
>
> On 7 Apr 2012, at 12:55, Samuel Jawahar <[email protected]> wrote:
>
> Hello if you have time can you please verify my algorithm to solve the
> milkshake problem
>
> start:
>
> For each test case
> declare malt and unmalt of size number of flavours,initial values of malt
> and unmalt are zeros
> 1)get all cutomer choices in to choices
> 2)customer's who have only one choice have to be full filled
> if unmalt flavour i is the only choices of the customer then increment the
> value of the unmalt[i]+=1
> if malt flavour i is the only choices of the customer then increment the
> value of the malt[i]+=1
> 3)check if any flavour i is malted and unmalted,then return "IMPOSSIBLE"
> 4)Otherwise check the customers who are having more then one choices
> for each choices either malted or unmalted at least one should satisfy
> below condition
> ex:3 1 flavour 3 malted
> if malt[3]==0 and unmalt[3]==0 then this customer chilce can be satified
> malt[3]+=1
> if unmalt[3]>0 this choice can not be satified
> ex:3 0 flavour 3 unmalted
> if malt[3]==0 and unmalt[3]==0 then this customer chilce can be satified
> unmalt[i]+=1
> if malt[3]>0 this choice can not be satified
> 5)at least one of the each customer choice are satisfied according to the
> step 4
> then print all malt[i] if malt[i]>0 print 1 else 0
>
> end:
>
> On Sat, Apr 7, 2012 at 3:52 PM, Abizern <[email protected]> wrote:
>
>> Not yet, but I'll consider doing a 'cast about it next.
>>
>>
>> On 7 April 2012 10:57, Samuel Jawahar <[email protected]> wrote:
>>
>>> Hello.did you solve the problem milkshake
>>> http://code.google.com/codejam/contest/dashboard?c=32016#s=p1&a=1
>>>
>>>
>>> On Sat, Apr 7, 2012 at 2:58 PM, Abizern <[email protected]> wrote:
>>>
>>>> I made a short screencast last night to show the process of solving a
>>>> problem, retrieving the input files and uploading the solutions for the
>>>> small and large cases.
>>>>
>>>> http://youtu.be/_tgv3HVgOMc?hd=1
>>>>
>>>> If you aren't interested in the (trivial) solution in Haskell, skip to
>>>> the last few minutes to see the mechanics of submitting the final solution
>>>> files.
>>>>
>>>> --
>>>> Abizer
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google Code Jam" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-code?hl=en.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>
>>
>>
>> --
>> Abizer
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.