文件名称:双向约瑟夫
介绍说明--下载内容均来自于网络,请自行研究使用
约瑟夫问题是一个经典的问题,我们不妨将这个经典问题进行扩展,变成一个双向的约瑟夫问题。
已知 n 个人(不妨分别以编号 1,2,3,...,n 代表 )围坐在一张圆桌周围,首先从编号为 k 的人从 1 开始顺时针报数,1, 2, 3, ...,记下顺时针数到 m 的那个人,同时从编号为 k 的人开始逆时针报数,1, 2, 3, ...,数到 m 后,两个人同时出列。然后从出列的下一个人又从 1 开始继续进行双向报数,数到 m 的那两个人同时出列,...;。依此重复下去,直到圆桌周围的人全部出列。直到圆桌周围只剩一个人为止。
如果双向报数报到 m 时落在同一个人身上,那本次出列的只有一个人。(The Joseph question is a classic question, and we might as well extend this classic problem into a two-way Joseph problem.
(as known n individuals respectively to number 1, 2, 3,..., n) sitting around a round table, the first k from a number of people from the beginning of 1 clockwise off, 1, 2, 3,..., the man down clockwise to the m, at the same time from number k people began to counterclockwise number, 1, 2, 3,..., m count, two people at the same time out. Then a column from the next person and from the beginning of 1 to the two two-way number, count m out at the same time,...;. This repeated until all of the people out around the table. Until there was only one person left around the round table.
If two back off m falls in the same person, the time out of only one person.)
已知 n 个人(不妨分别以编号 1,2,3,...,n 代表 )围坐在一张圆桌周围,首先从编号为 k 的人从 1 开始顺时针报数,1, 2, 3, ...,记下顺时针数到 m 的那个人,同时从编号为 k 的人开始逆时针报数,1, 2, 3, ...,数到 m 后,两个人同时出列。然后从出列的下一个人又从 1 开始继续进行双向报数,数到 m 的那两个人同时出列,...;。依此重复下去,直到圆桌周围的人全部出列。直到圆桌周围只剩一个人为止。
如果双向报数报到 m 时落在同一个人身上,那本次出列的只有一个人。(The Joseph question is a classic question, and we might as well extend this classic problem into a two-way Joseph problem.
(as known n individuals respectively to number 1, 2, 3,..., n) sitting around a round table, the first k from a number of people from the beginning of 1 clockwise off, 1, 2, 3,..., the man down clockwise to the m, at the same time from number k people began to counterclockwise number, 1, 2, 3,..., m count, two people at the same time out. Then a column from the next person and from the beginning of 1 to the two two-way number, count m out at the same time,...;. This repeated until all of the people out around the table. Until there was only one person left around the round table.
If two back off m falls in the same person, the time out of only one person.)
相关搜索: 双向约瑟夫
(系统自动生成,下载前可以参看下载内容)