约瑟夫环
约瑟夫问题是个有名的问题:N个人围成一圈,从第一个开始报数,第M个将被杀掉,最后剩下一个,其余人都将被杀掉。例如N=6,M=5,被杀掉的顺序是:5,4,6,2,3,1。
我爱卷粉
不会学到会。
展开
-
G - And Then There Was One
Let’s play a stone removing game. Initially, n stones are arranged on a circle and numbered 1, …, n clockwise (Figure 1). You are also given two numbers k and m. From this state, remove stones one by...原创 2018-07-27 09:40:24 · 103 阅读 · 0 评论 -
F - System Overload
Recently you must have experienced that when too many people use the BBS simultaneously, the net becomes very, very slow. To put an end to this problem, the Sysop has developed a contingency scheme fo...原创 2018-07-27 09:38:41 · 171 阅读 · 0 评论