That isn't as obvious as it probably should be, and it took me a while to figure it out.
Obviously, for any deck of size K, there is one and only one arrangement of the deck cards to constitutes a "perfect" solution. But once K gets up into the hundreds of cards, it just isn't practical to send the entire deck solution back as your output, hence the second line. The second line of N and Nx indicates which indexes of the "perfect" deck configuration should be returned as your program output. If Nx is 1, return the number of the card on top of the deck (which incidently, will always be 1). If Nx is 10, return the number of the 10th card in the solution deck, if 100, return the 100th card in the solution deck. With the card deck sizes included in the large data set, it is obviously impossible to compute the entire perfect deck configuration, so much of the trickiness comes from devising algorithms that only return the cards at the specified indexes while ignoring all of the others. Have a nice day, -Ken On Sunday 30 August 2009 21:37:27 parashar.ankur wrote: > for the Input Case.. > Input > 2 > 5 > 5 1 2 3 4 5 > 15 > 4 3 4 7 10 > > the output is > > Output > Case #1: 1 3 2 5 4 > Case #2: 2 8 13 4 > > i got the case 1 bt unable to understand case2 somebody tell me in > detail my be i'm getting this question wrong. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-codejam" 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 -~----------~----~----~----~------~----~------~--~---
