- 博客(6)
- 收藏
- 关注
原创 F - Prime Path --BFS广搜
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of sec...
2018-05-21 21:40:11 179
原创 筛选法求素数表----埃拉托斯特尼筛法
适用于题目的数据规模较大,常规地逐个判断素数的方法行不通,可以使用筛选法进行预处理,将所有素数一次性求出并存入数组中。分析:从2开始,将每个素数的各个倍数,标记成合数。一个素数的各个倍数,是一个差为此素数本身的等差数列。实现:建立一个bool类型的数组,一个int类型的数组prime储存素数,初始化为0(都是素数),从第一个素数2开始,把2的倍数都标记为非素数(1),直到大于n;然后进行下一趟,找...
2018-05-19 17:31:43 978
原创 Shuffle'm Up ----bfs
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Ea...
2018-05-19 15:59:14 190
原创 Prime Ring Problem
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number o
2018-05-19 15:49:05 283
原创 Prime Ring Problem
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number o
2018-05-09 20:54:15 127
原创 Wireless Network
Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all compu
2018-05-04 16:56:43 156
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人