【Description】 This problem is based upon a report by the historian Joseph ben Matthias (Josephus) on the outcome of a suicide pact that he had made between himself and 40 soldiers as they were besi
问题描述: 有 n 个人围成一个圈,从第 k 个人开始从 1 开始一个人一个人的报数,数到第 m 个人,让他出列;然后从出列的下一个人重新开始报数,数到第 m 个人,再让他出列,……,如此反复直到圆圈中只剩一个人为止,请模拟这一工作过程。即已知:人数 n,初始编号 k,出列值 m,而且每次的 m 值都不一样;输出整个过程中,出列编号的序列 L,以及最后留下的元素位置。 建立一个无头结点的单向循