上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: HDU 3068 http://acm.hdu.edu.cn/showproblem.php?pid=3068 HDU 3294http://acm.hdu.edu.cn/showproblem.php?pid=3294 感觉DP相对实现起来更简洁一些,很容易想到,可以用bool dp[i][j]: 阅读全文
posted @ 2017-08-24 15:43 #Egoist# 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 有N种物品,每种物品的数量为C1,C2……Cn。从中任选若干件放在容量为W的背包里,每种物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够容纳的最大价值。 Input 第1行,2个整数,N和W中间用空格隔开。N为物品的种类,W为背包的容量。( 阅读全文
posted @ 2017-08-23 21:42 #Egoist# 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有 阅读全文
posted @ 2017-08-23 15:53 #Egoist# 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate 阅读全文
posted @ 2017-08-23 15:11 #Egoist# 阅读(209) 评论(0) 推荐(0) 编辑
摘要: The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies 阅读全文
posted @ 2017-08-23 14:43 #Egoist# 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 医学界发现的新病毒因其蔓延速度和Internet上传播的"红色病毒"不相上下,被称为"红色病毒",经研究发现,该病毒及其变种的DNA的一条单链中,胞嘧啶,腺嘧啶均是成对出现的。 现在有一长度为N的字符串,满足一下条件: (1) 字符串仅由A,B,C,D四个字母组成; (2) A出现偶数次(也可以不出 阅读全文
posted @ 2017-08-22 21:16 #Egoist# 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。 例如:3*3的矩阵: -1 3 -1 2 -1 3 -3 1 2 和最大的子矩阵是: 3 -1 -1 3 1 2 Input第1行:M和N,中间用空格隔开(2 <= M,N <= 500)。 第2 - N 阅读全文
posted @ 2017-08-22 20:07 #Egoist# 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 给出N个正整数,找出N个数两两之间最大公约数的最大值。例如:N = 4,4个数为:9 15 25 16,两两之间最大公约数的最大值是15同25的最大公约数5。 Input第1行:一个数N,表示输入正整数的数量。(2 <= N <= 50000) 第2 - N + 1行:每行1个数,对应输入的正整数. 阅读全文
posted @ 2017-08-22 16:08 #Egoist# 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Given a N × N matrix A, whose element in the i-th row and j-th column Aij is an number that equals i2 + 100000 × i + j2 - 100000 × j + i × j, you are 阅读全文
posted @ 2017-08-21 21:44 #Egoist# 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Farmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the circus. Their hoofed feet prevent them from tightrope wa 阅读全文
posted @ 2017-08-21 20:47 #Egoist# 阅读(230) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页