-
双向约瑟夫问题
约瑟夫问题是一个经典的问题,我们不妨将这个经典问题进行扩展,变成一个双向的约瑟夫问题。
已知n个人(不妨分别以编号1,2,3,…,n 代表 )围坐在一张圆桌周围,首先从编号为 k 的人从1开始顺时针报数,1, 2, 3, ...,记下顺时针数到 m 的那个人,同时从编号为 k 的人开始逆时针报数,1, 2, 3, ...,数到 m 后,两个人同时出列。然后从出列的下一个人又从 1 开始继续进行双向报数,数到m的那两个人同时出列,…;。依此重复下去,直到圆桌周围的人全部出列。直到圆桌周围只剩一个人为止。
如果双向报数报到 m 时落在同一个人身上,那本次出列的只有一个人。
请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
- 2022-02-15 10:54:04下载
- 积分:1
-
This is the basis of a change of netizens eight digital procedures, the operatin...
这是我根据 一个网友 改变的 八数码 程序,在Bcb6环境下运行-This is the basis of a change of netizens eight digital procedures, the operating environment Bcb6
- 2022-04-11 07:44:38下载
- 积分:1
-
hao
hao -hao hao
- 2022-08-18 13:36:33下载
- 积分:1
-
用turbe c开发的贪吃蛇游戏,对初学者有用。
用turbe c开发的贪吃蛇游戏,对初学者有用。-Turbe c with the development of Snake game, useful for beginners.
- 2023-04-20 17:25:02下载
- 积分:1
-
最佳适应算法是动态内存分区分配算法的一种。所谓“最佳”是指每次为作业分配内存时,总是把能满足要求、又是最小的空闲分区分配给作业,避免“大材小用”。为了加速寻找,...
最佳适应算法是动态内存分区分配算法的一种。所谓“最佳”是指每次为作业分配内存时,总是把能满足要求、又是最小的空闲分区分配给作业,避免“大材小用”。为了加速寻找,该算法要求将所有的空闲分区按其内容以从小到大的顺序形成一空闲分区链。这样,第一次找到的能满足要求的空闲区,必然是最佳的。-best adaptation algorithm is a dynamic memory allocation through an algorithm. The so-called "best" means the operation of each memory allocation, always meet requirements, and also the smallest area allocated to idle operations, to avoid "a waste of talent." To speed up the search, the algorithm requires that all leisure district according to content from small to large order of the formation of a regional chain idle. So, the first found to meet the requirements of the free zone will be the best.
- 2022-05-21 23:44:10下载
- 积分:1
-
visual basic程序实现凸轮机构设计
visual basic程序实现凸轮机构设计-visual basic cam design program
- 2022-04-27 00:38:21下载
- 积分:1
-
俄罗斯方块小游戏 可以很好的运行并带有简单的音乐
俄罗斯方块小游戏 可以很好的运行并带有简单的音乐-Tetris game is well run and with a simple music
- 2022-03-07 00:08:52下载
- 积分:1
-
运用VHDL,完成数据选择器的功能。数据选择器
运用VHDL,完成数据选择器的功能。数据选择器-data select
- 2023-02-09 21:15:03下载
- 积分:1
-
chipbank芯邦的USB芯片的制作的U盘格式化软件。支持芯邦的所有USB主控芯片,同时对海力士、三星等Flash都能够支持。...
chipbank芯邦的USB芯片的制作的U盘格式化软件。支持芯邦的所有USB主控芯片,同时对海力士、三星等Flash都能够支持。-Chipsbrand chipbank the USB chips produced by U disk formatting software. Chipsbrand support all USB control chip, while Hynix, Samsung will support Flash and so on.
- 2022-03-18 10:17:42下载
- 积分:1
-
可设定时间的遥控倒计时定时器,可选择15/30/45分钟倒计时
可设定时间的遥控倒计时定时器,可选择15/30/45分钟倒计时-The remote control can set the time the countdown timer, selectable 15/30/45 minute countdown
- 2022-09-27 09:05:03下载
- 积分:1