To ZhenLiangSC: I am afraid not.
If a person is removed, he won't be counted after that. ps. The best algorithm I can find is O(NlogN), by employing an interval tree or something like that. Sorry for my poor English, too... :) "[EMAIL PROTECTED] 写道: " > first put f to the temp=k-th position,than put to the temp=k*2 > position...... > when temp=k*n>x+y,make temp=temp-(x+y) > until y times > right? > i am not good at English,sorry. > > On 12月8日, 下午2时23分, "Darth" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I think this is a standard problem but can't remember what is the exact > > name assigned to this problem. Neways, plz help me solve this one. > > > > The problem is as follows : > > > > Given X number of males and Y number of females and a number k, > > construct an arrangement of the males and females in a circle so that > > starting at the first person and removing every person at a distance of > > k-1 in clockwise direction, Y number of times only males remain in the > > circle. > > > > For e.g. X=5,Y=3,k=2 > > > > "MFMFMFMM" > > > > The distance between neighbours in the circle(ring) is 1(one). > > > > TIA, > > Darth --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups-beta.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---