搜索资源列表
123
- 约瑟夫问题 编号为1,2,3,…,n的n个人按顺序针方向围坐一张圆桌旁,每个人手中持有 一个密码(正整数)。首先输入一个正整数作为报数上限值m,然后,从第一个人开始按顺序针方向自1开始顺序报数,报到m的人离开桌子,并将他手中的密码作为新的m值,从顺序针方向的下一个就坐在桌旁的人开始重新从1报数,如此下去,直至所有人全部离开桌旁为止。-Joseph issues numbered 1,2,3, ..., n of the n individuals in accordance with t
4.22
- 15名基督教徒和15名异教徒同乘一船航行,途中风浪大作,危机万分,领航者告诉大家,只要将全船的一半人投入海中,其余人就能幸免。大家都同意这个办法,并协定者30人围成一圈;由第一个人起报数,每数至第9人便把他投入海中,下一个接着从1开始报数,第9人又被投入海中,依次循环,直至剩下15人为止。问题是如何排法使投入海中的人全为异教徒?-15 Christians and 15 pagans take a boat sailing with the way waves rang out, the cri
Josephloopproblem
- 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。-Known n individuals (with numbers 1,2,3 ... n, respectively) were sitting around a round table around. From the number of k, the number of people
Josephus
- 设有n个人围坐在一个圆桌周围,现从第s个人开始报数,数到第m的人出列,然后从出列的下一个人重新开始报数,数到第m的人又出列,…,如此反复直到所有的人全部出列为止。Josephus问题是:对于任意给定的n,s和m,求出按出列次序得到的n个人员的序列。-With n individuals sitting around a round table is starting from the first s individuals reported number, the number of peopl
1055
- There are 10 kinds of people -- those who understand binary and those who don t. 大家一定都玩过数七这个游戏。游戏的规则很简单,几个人围成一个圈,从1开始报数,数到7的倍数或者含有7的数字的数就不能出声,要用其他方式表示自己已经报过数字,如果报错了就要受到惩罚。游戏的乐趣在于简单的规则下,总是有人会数错。 作为ACMer,大家都认为这个游戏不符合ACMer的身份。于是TheBeet决定改一下规则,让大
qiangdaqi
- 所设计的抢答器允许四人参加。在出题后,红色发光二极管点亮,同时显示器显示秒信号,A、B、C、D四人按动按钮以决定先后次序,计时到60s之后即依次显示四个人的名次,若超过60s未按按钮者不计名次。在红灯亮前按下按钮者也不计名次。-The Responder is designed to allow four people to participate. In a later question, the red light-emitting diodes lit at the same time d
finished
- 试用分别用线性表的向量存储结构和链表存储结构来实现约瑟夫(Josephu)问题。约瑟夫问题如下: 设有n个人围坐圆桌周围。从某个位置上的人开始从1报数,数到m的人便出列,下一个人(第m+1个)又从1报数开始,数到m的人便是第2个出列的人,依次类推,直到最后一个人出列为止,这样就可以得到一个人员排列的新次序。例如,n=8,m=4,从第1个人数起,得到的新次序为48521376.-Trial were linear vector table storage structure and th
17people_count
- 17依次报数,去除3的倍数,然后继续再报数。。。直到剩一个人,问这个人是原来队列中的第几个人?-17 reported that the number of turn to remove a multiple of 3, and then continue again count off. . . Until the left one person asked this person is the original queue, the first few people?
Catholics
- w-w1各教徒和w1个非教徒在海上遇险,必须将一半的人投到海中,其余的人才能幸免,于是想了个办法w人围成一圈从第一人开始报数,数到第w2个就将其人丢入海中,又从下个人数,数到第w2个人又丢入海中,依次循环,怎样排才使投入大海的都是非教徒-w-w1 and w1 of all non-believers believers in distress at sea, half of them must be invested in the sea, the others can be spared,
jiaotu
- w-w1各教徒和w1个非教徒在海上遇险,必须将一半的人投到海中,其余的人才能幸免,于是想了个办法w人围成一圈从第一人开始报数,数到第w2个就将其人丢入海中,又从下个人数,数到第w2个人又丢入海中,依次循环,怎样排才使投入大海的都是非教徒-w-w1 and w1 of all non-believers believers in distress at sea, half of them must be invested in the sea, the others can be spared,
JosephRing
- 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 -Known n individuals (in numbers 1,2,3 ... n respectively) sitting around a round table around. From the number of people began to report the num
Josephwayissue
- Known n individuals (respectively number might 1,2,3, ..., n behalf of) sitting around a round table around, starting with number 1 for the k, starting clockwise from the number reported, 1, 2, 3,. .., note the number of clockwise to m the man and,
yuesefuhuan
- 约瑟夫环 是一个数学的应用问题: 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 例如:n = 9, k = 1, m = 5 【解答】 出局人的顺序为5, 1, 7, 4, 3, 6, 9, 2, 8。 -Joseph Wan is the application of a mathematic
Josephus
- 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 -Known n individuals (in numbers 1,2,3 ... n respectively) sitting around a round table around. From the number of people began to report the numbe
Josephus
- 是一个数学的应用问题: 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 -The application is a mathematical problem: given n individuals (in numbers 1,2,3 ... n, respectively) sitting around a round table a
quan
- 设有N个人围坐一圈,现从某个人开始报数,数到M的人出列,接着从出列的下一个人开始重新报数,数到M的人又出列,如此下去,直到所有的人都出列为止。试设计确定他们的出列次序序列的程序。-Sitting around a circle with N individuals are reported from a number of individuals began, the number of people out of the column to the M, then the next perso
ysf
- 约瑟夫环: 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 -Joseph Central: Given n individuals (with numbers 1,2,3 ... n, respectively) sitting around a round table around. From the number of people
Joseph-cycle
- 是一个数学的应用问题: 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 -The application is a mathematical problem: given n individuals (in numbers 1,2,3 ... n, respectively) sitting around a round table a
Josephu
- Josephu 问题为:设编号为1,2,… n的n个人围坐一圈,约定编号为k(1<=k<=n)的人从1开始报数,数到m 的那个人出列,它的下一位又从1开始报数,数到m的那个人又出列,依次类推,直到所有人出列为止,由此产生一个出队编号的序列。-Josephu issues: Let numbered 1,2, ... n of the n individuals sitting around, agreed number k (1 < = k < = n) the number
shengsiyouxi
- 约瑟夫双向生死游戏是在约瑟夫生者死者游戏的基础上,正向计数后反向计数,然后再正向计数。具体描述如下:30个旅客同乘一条船,因为严重超载,加上风高浪大,危险万分;因此船长告诉乘客,只有将全船一半的旅客投入海中,其余人才能幸免遇难。无奈,大家只得同意这种办法,并议定30个人围成一圈,由第一个人开始,顺时针依次报数,数到第9人,便把他投入大海中,然后从他的下一个人数起,逆时针数到第5人,将他投入大海,然后从他逆时针的下一个人数起,顺时针数到第9人,再将他投入大海,如此循环,直到剩下15个乘客为止。问哪