Location:
Search - yuesefuhua
Search list
Description: 约瑟夫环问题:任给正整数N和K,按下述方法可以得到1,2, …,n的一个置换,将数字1,2,…,n环形排列,按顺时针方向自1开始报数,报到K时输出该位置上的数字,并使其出列。然后从他在顺时针方向的下一个数字继续报数,如此下去,直到所有的数字全部出列为止。例如N=10,K=3,则正确的出列顺序应为3,6,9,2,7,1,8,5,10,4。-Joseph Central questions: any given positive integer N and K, the following methods can be 1,2, ..., n a replacement, the number 1,2, ..., n the ring with, according to a clockwise direction from 1 to start off , K report output figures on the location and make it a column. And then in a clockwise direction from him the next figures to continue to count off, so until all the numbers all out of date. For example, N = 10, K = 3, then the correct order of the column should be 3,6,9,2,7,1,8,5,10,4.
Platform: |
Size: 1024 |
Author: 刘慧 |
Hits: