Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - josephus
Search - josephus - List
一个关于约瑟夫环的程序-one of the procedures Josephus
Date : 2008-10-13 Size : 794byte User : 周民

一个关于约瑟夫环的程序-one of the procedures Josephus
Date : 2026-01-09 Size : 1kb User : 周民

约瑟夫问题是个有名的问题:N个人围成一圈,从第一个开始报数,第M个将被杀掉,最后剩下一个,其余人都将被杀掉。例如N=6,M=5,被杀掉的人的序号为5,4,6,2,3。最后剩下1号。 假定在圈子里前K个为好人,后K个为坏人,你的任务是确定这样的最少M,使得所有的坏人在第一个好人之前被杀掉。-Josephus problem is a well-known problem: N personal circle, starting from the first report the number of M will be killed first, the last remaining one, the rest will be killed. For example, N = 6, M = 5, the number of people killed 5,4,6,2,3. The last remaining No. 1. Assumed that the first K in circles as a good man, after the K was bad person, your task is to determine this minimum M, makes all the bad guys in a good man before being killed.
Date : 2026-01-09 Size : 874kb User : cyr

用数组解JOSEPHUS问题的程序源码,绝对没有错误,很好,不错()
Date : 2026-01-09 Size : 2kb User : kpxignal
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.