- 博客(19)
- 收藏
- 关注
原创 Prime Time
Prime Time链接Euler is a well-known matematician, and, among many other things, he discovered that the formulan2 + n + 41 produces a prime for 0 ≤ n < 40. For n = 40, the formula produces 1681, wh...
2019-08-12 15:19:35 427
原创 The Falling Leaves
The Falling LeavesEach year, fall in the North Central region is accompanied by the brilliant colors of the leaves on thetrees, followed quickly by the falling leaves accumulating under the trees. I...
2019-08-11 18:43:27 260
原创 Quadtrees
Quadtrees(四叉树)A quadtree is a representation format used to encode images. The fundamental idea behind the quadtreeis that any image can be split into four quadrants. Each quadrant may again be spli...
2019-08-11 18:36:17 340
原创 Mysterious Bacteria
Mysterious BacteriaDr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new deadly...
2019-08-11 18:28:37 370
原创 Help Hanzo
Help HanzoAmakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakurur...
2019-08-11 18:25:25 248
原创 Primes
Primes题目Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2...
2019-08-11 18:21:56 476
原创 Goldbach`s Conjecture
Goldbach`s ConjectureGoldbach’s conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the su...
2019-08-10 21:43:30 166
原创 Arbitrage
Arbitrage (最短路)Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar...
2019-07-28 19:00:46 297
原创 Cash Machine
Cash Machine (背包)A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denomi...
2019-07-28 18:48:56 364
原创 FatMouse and Cheese
FatMouse and Cheese (记忆化)FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <=...
2019-07-28 18:44:15 454
原创 Til the Cows Come Home
Til the Cows Come Home (dijkstra)题目Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs he...
2019-07-28 18:19:47 310
原创 最大连续子序列
最大连续子序列题目给定K个整数的序列{ N1, N2, …, NK },其任意连续子序列可表示为{ Ni, Ni+1, …,Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个,例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和为20。在今年的数据结构考...
2019-07-28 17:37:05 139
原创 Wormholes
Wormholes(SPFA判负权环)While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destinat...
2019-07-28 16:20:15 267
原创 Maximum Sum
Maximum Sum UVA - 108(二维子矩阵最大和)A problem that is simple to solve in one dimension is often much more difficult to solve in more thanone dimension. Consider satisfying a boolean expression in conjunc...
2019-07-21 19:56:38 431
原创 Find The Multiple
Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater ...
2019-07-21 19:38:25 156
原创 N皇后问题
Maximum Sum (二维矩阵子序列最大和 最大连续子序列)链接翻译在一个维度中很容易解决的问题往往在多个维度中更难解决。考虑满足连接正规形式的布尔表达式,其中每个连接正好由3个析取组成。这个问题(3-sat)是NP完全问题。然而,2-SAT问题得到了相当有效的解决。相比之下,有些问题属于同一个复杂度类,与问题的维度无关。给定一个由正整数和负整数组成的二维数组,找出最大和的子矩形。矩...
2019-07-21 19:15:11 450
原创 Palindrome
Palindrome(最长公共子序列 滚动数组)链接A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, ...
2019-07-21 18:53:06 917
原创 hao many ways(记忆化搜索)
hao many ways(记忆化搜索)链接题目这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。...
2019-07-21 18:06:24 148
原创 Watering Grass(贪心) [link]
Watering Grass(贪心) link.翻译n洒水器安装在水平的草条上,草条长l米,宽w米。每个喷水器安装在条带的水平中心线上。对于每个喷水装置,我们都将定位距中心线左端的距离及其工作半径。为了给整片草地浇水,最少要打开多少个洒水器?输入输入由多个事例组成。每种情况的第一行包含整数n、l和wn≤10000。接下来的n行包含两个整数,给出喷水器的位置及其半径。操作。(上图说...
2019-07-20 10:23:18 308
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人