ITeye博客

Last Survival

standalone · 2011-06-30 16:02 · algorithm · 编程语言 · Markdown

There are 100 people forming a circle and they are numbered from 1 to 100. They decide to kill each other using a sword, in following manner. At any point, person numbered n having a sword kills person numbered n+1 and passes the sword to n+2. This process doesnt stop untill at the end only 1 person remains alive. Initially, person numbered 1 has the sword in hand. Calculate the survivor number. What about any general N ?

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。