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

双向约瑟夫问题

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

代码说明:

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

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

发表评论

0 个回复

  • 施乐dc156罗林罗我粪
    xerox dc156 rom dung de lam rom moi
    2023-08-22 01:15:03下载
    积分:1
  • C 语言编辑器(具有编辑器,编译器诸多功能)
    C 语言编辑器(具有编辑器,编译器诸多功能)-C language editor (with the editor, compiler many functions)
    2022-03-17 06:46:18下载
    积分:1
  • CString usage of Windows services, including the four major parts: First, Servic...
    CString用法 Windows服务包括四大部分: 一,服务控制管理器(Service Control Manager)。是系统中的一个RPC服务器,总管所有服务,“Admin$System32Services.exe”。拥有一个在注册表中记录的数据库,包含了所有已安装的服务程序和设备驱动服务程序的相关信息。 二,服务控制程序(Service Control Program)。用来执行对服务程序的开启、控制和状态查询功能。 三,服务程序(Service Program)。服务的执行代码。 四,服务配置程序(Service Configuration Program)。 用来更改,查询已安装服务的信息。-CString usage of Windows services, including the four major parts: First, Service Control Manager (Service Control Manager). Is an RPC system servers, all mains services,
    2022-04-24 01:16:09下载
    积分:1
  • C语言菜鸟参考习题小汇总
    资源描述初学C语言时,是否为找不到满足心意的训练头脑的题目而感到烦恼呢?就让压缩包中的习题带你一起飞越C语言程序设计的思维高度,使你的水平上一层楼!
    2022-03-25 06:36:19下载
    积分:1
  • 潜艇大战 经典游戏原码
    潜艇大战 经典游戏原码-World War II submarine game classic original code
    2023-06-17 18:55:03下载
    积分:1
  • 是一种主动探测工具pathChirp估计的可用带宽
    pathChirp is an active probing tool for estimating the available bandwidth on a communication network path. Based on the concept of "self-induced congestion," pathChirp features an exponential flight pattern of probes we call a chirp. Packet chirps offer several significant advantages over current probing schemes based on packet pairs or packet trains. By rapidly increasing the probing rate within each chirp, pathChirp obtains a rich set of information from which to dynamically estimate the available bandwidth.
    2022-01-25 22:17:59下载
    积分:1
  • MATLAB Programming Guide,
    MATLAB程序设计教程》源代码-2660 MATLAB程序设计教程》源代码-2660 MATLAB程序设计教程》源代码-2660-MATLAB Programming Guide,
    2023-06-19 22:45:04下载
    积分:1
  • draw canvas
    draw canvas
    2022-02-03 13:19:32下载
    积分:1
  • 这是485芯片的USB通信源码,实现和电脑的通信
    这是485芯片的USB通信源码,实现和电脑的通信-This is the 485 chip USB communication source to achieve and computer communications
    2022-01-26 07:53:08下载
    积分:1
  • 这是一个非常实用的网页素材。点点的星光让你的主页更加引人注。...
    这是一个非常实用的网页素材。点点的星光让你的主页更加引人注目。-This is a very useful material to the website. Stars bit of the home page will let you more visible.
    2022-05-09 14:04:12下载
    积分:1
  • 696524资源总数
  • 103945会员总数
  • 46今日下载