上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: quicksum Given a string of digits, find the minimum number of additions required for the string to equal some target number. Each addition is the equi 阅读全文
posted @ 2016-03-29 23:22 Orion_7 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an ordering on the elements in V, then the bandwidth of a node v is d 阅读全文
posted @ 2016-03-28 23:09 Orion_7 阅读(255) 评论(0) 推荐(0) 编辑
摘要: You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physical abilities. In one s 阅读全文
posted @ 2016-03-24 23:30 Orion_7 阅读(274) 评论(0) 推荐(0) 编辑
摘要: A ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately, and the sum of numbers in two adja 阅读全文
posted @ 2016-03-24 00:02 Orion_7 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 编程很简单,关键在于数学推导。 ∵x≥y ∴1/x≤1/y ∴1/k=1/x+1/y≤2/y 即y≤2k 又易知y>k 在此范围内枚举即可。 验证时, 由1/k=1/x+1/y 得x=ky/(y-k), 判断上式是否为整数即可。 阅读全文
posted @ 2016-03-23 23:25 Orion_7 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 由于n很小,枚举起点和终点即可。 由于存在0,不能用“前缀积”数组。 阅读全文
posted @ 2016-03-23 23:05 Orion_7 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 枚举分母,验证分子。当分子超过五位时停止。注意前导0的处理。 阅读全文
posted @ 2016-03-23 22:44 Orion_7 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题意需要几步转化。 关键要自己手画几个图感受一下。 避免攻击离开战场 →1.以敌人为障碍物,找到一条从左到右的通路。 →2.以敌人为路,找到一条从上到下的通路。(如果有一条上下贯通的路,则一定把地图分为左右两部分,即不存在左右通路。) 从每个与上边界相交或相切的圆开始搜索和它相交或相切的圆。如果搜到 阅读全文
posted @ 2016-03-23 00:07 Orion_7 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 所求路线有两个要求,一是距离最短,二是在一的前提下字母序最小。因此进行BFS时,需要同时顾及两个因素。 保证距离最短时,可以先从终点出发求一遍最短路,这样每次BFS时只要保证下一步的点的最短路比当前点小1,最后求出来的就一定是最短路。 处理字典序时,采用贪心策略,即从头开始每一步都要最小。对一个点操 阅读全文
posted @ 2016-03-20 22:31 Orion_7 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 算法实现其实很简单,关键需要想明白。 只要边上的标号重复,那就一定可以通过不断的翻转无限延伸。 于是我们可以把每种标号看成一个点,每个正方形看成若干条边(比如,正方形上有两条边标号分别是A+,B-,那就分别连A-→B-,B+→A+,表示如果目前有一条边缘是A-,那么就可以有一个边缘是B-。 如果图中 阅读全文
posted @ 2016-03-20 20:01 Orion_7 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页