登录
首页 » 其他项目 » 双向约瑟夫问题

双向约瑟夫问题

于 2022-02-15 发布 文件大小:6.93 kB
0 205
下载积分: 2 下载次数: 1

代码说明:

约瑟夫问题是一个经典的问题,我们不妨将这个经典问题进行扩展,变成一个双向的约瑟夫问题。 已知n个人(不妨分别以编号1,2,3,…,n 代表 )围坐在一张圆桌周围,首先从编号为 k 的人从1开始顺时针报数,1, 2, 3, ...,记下顺时针数到 m 的那个人,同时从编号为 k 的人开始逆时针报数,1, 2, 3, ...,数到 m 后,两个人同时出列。然后从出列的下一个人又从 1 开始继续进行双向报数,数到m的那两个人同时出列,…;。依此重复下去,直到圆桌周围的人全部出列。直到圆桌周围只剩一个人为止。    如果双向报数报到 m 时落在同一个人身上,那本次出列的只有一个人。 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 使用matlab源码控制并联机器人的制备
    使用matlab编写并联机器人控制的源程序-The preparation of parallel robot using matlab source control
    2022-01-22 06:44:00下载
    积分:1
  • 异形按纽,绝对异型
    异形按纽,绝对异型-square button absolutely abnormal
    2022-08-03 01:27:18下载
    积分:1
  • 程序描述:这个程序利用89S51连接DAC0800,然后通过Timer0 的控制不停地送出三角波 */...
    程序描述:这个程序利用89S51连接DAC0800,然后通过Timer0 的控制不停地送出三角波 */-Description: 89S51 use this procedure to connect DAC0800, and then through the Timer0 kept out of the control triangle wave* /
    2022-01-21 06:04:51下载
    积分:1
  • 词法分析程序的C语言程序框架,加深对词法分析原理的理解
    词法分析程序的C语言程序框架,加深对词法分析原理的理解-lexical analysis procedure of the C Programming Language framework of lexical analysis to deepen the understanding of the principles
    2022-03-18 16:39:54下载
    积分:1
  • 用OpenGl实现自己姓名的三维图像,像行星围绕太阳转一样围绕一个轨道旋转...
    用OpenGl实现自己姓名的三维图像,像行星围绕太阳转一样围绕一个轨道旋转-OpenGl realize their own name with three-dimensional image
    2023-08-20 19:40:04下载
    积分:1
  • tutorial6 TLM
    OSCI组织最新lease出来的传输级建模指导实验,对初学者快速认识TLM中的一些基本概念很有用,本实验经作者修改并调试通过。-The tutorial6 of TLM-2.0 which is released from OSCI group currently!
    2022-05-05 14:33:38下载
    积分:1
  • Hspice仿真工具箱
    hspice的matlab工具箱,可以读取Hspice的输出文件,放到matlab中处理-hspice matlab toolbox
    2023-07-28 21:45:07下载
    积分:1
  • C++ Primer的第三版结合了Stanley Lippman的实践经验和Josée Lajoie对于ANSI/ISO标准C++的深入理解。这本指导书的第三版...
    C++ Primer的第三版结合了Stanley Lippman的实践经验和Josée Lajoie对于ANSI/ISO标准C++的深入理解。这本指导书的第三版已经被重新改写过,以便更加精确地讲述标准C++的特性和用法。在本书中,对于C++初学者特别有价值的是一些来自真实世界中的程序例子,它们说明了泛型程序(generic program)的设计、面向对象程序的设计、模板的用法,以及使用标准C++进行程序设计的方方面面。而且,本书也在适当的地方讲到了一些习惯用法以及效率指导。-C Primer combination of the third edition of the Stanley Lippman had practical experience and Jose; for ANSI/ISO C standard in-depth understanding. This third edition of the guide book has been redrafted too, to be more precise description of the C standard features and usage. In the book, for C beginners particular value of some real-world examples of the procedures, they show Generic procedures (generic program) in the design, object-oriented design, the use of templates, and the use of standard C for all aspects of the design process. Moreover, the book was also the right place describes some of the efficiency and usage guide.
    2023-04-14 20:45:03下载
    积分:1
  • Map coloring problem, using lingo9.0 program
    地图着色问题,用lingo9.0程序实现-Map coloring problem, using lingo9.0 program
    2022-03-19 07:00:27下载
    积分:1
  • 操作系统上机os_4设备管理
    操作系统上机os_4设备管理-operating system on the plane os_4 equipment management
    2022-03-21 11:38:46下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载