Step 4 still might make some unwarranted assumptions. For example: Customer A: Flavour 1 Malted Customer B: Flavour 2 Unmalted, Flavour 3 Malted Customer C: Flavour 1 Unmalted, Flavour 2 Malted
On 7 Apr 2012, at 14:52, Samuel Jawahar <[email protected]> wrote: > updated > Start: > All choices for the malt are moved the end if the choice list > ex:3 1,2 0,1 0 given > 2 0,2 0,3 1 arranged is the pre condition for this algorithm > 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[i]+=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 > 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 5:08 PM, Samuel Jawahar <[email protected]> wrote: > Hello Bartholomew > I have solved the > Milkshake(http://code.google.com/codejam/contest/dashboard?c=32016#s=p1&a=1) > problem with below algorithm > 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: > i am getting incorrect answer can you please have a look on my algorithm > Regards > Samuel > > On Wed, Apr 4, 2012 at 10:19 PM, Bartholomew Furrow <[email protected]> wrote: > Your numbers are a bit low for input and output files -- we let those get as > high as 200kB (the input files can actually be bigger, but max out at 200kB > gzipped -- all modern browsers [as far as I can tell] automatically request a > gzipped version from the server). Bala, for my own information, how fast is > your connection in kB/s? > > > On Wed, Apr 4, 2012 at 4:58 AM, Amahdy <[email protected]> wrote: > At the beginning of the competition, due to the very heavy load and number of > people loading the competition page, there may be a delay not due to your > internet but due to Google's server load. (Specially in Round1 (A, B, & C)) > But other than that, you need to load the question page once (~ 2K), download > the input files (~5K) and upload yours (~ 5K also). Which I assume is good > enough over 2G. > > p.s. There should be an improvement in the Google's server load, so maybe you > won't even encounter the firstly mentioned problem. > > -- AMahdy! > www.amahdy.net > > > > On Wed, Apr 4, 2012 at 13:12, bala subramanian <[email protected]> wrote: > Hi I am using 2g network only.its enough for google code jam or we > need high speed for gcj.please give me solution. > > -- > 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. -- 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.
