
DP
titi2018815
菜鸟正在一步步成长!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
F - Super Jumping! Jumping! Jumping!
题目:Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The ...原创 2018-08-26 17:24:48 · 213 阅读 · 0 评论 -
Apple Catching POJ - 2385
题目:It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when t...原创 2019-09-27 21:51:57 · 144 阅读 · 0 评论 -
Cow Bowling POJ - 3176
题目:The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this: 7...原创 2019-09-27 18:55:02 · 120 阅读 · 0 评论 -
蓝桥杯 算法训练 6-1 递归求二项式系数值
题目:问题描述样例输入一个满足题目要求的输入范例。3 10样例输出与上面的样例输入对应的输出。数据规模和约定 输入数据中每一个数的范围。 例:结果在int表示时不会溢出。思路:这道题的题目已经给出了解决的方法:递归。剩下的,我的第一反应就是打表,因为题目中给出的数据范围是不会超出整型,所以直接暴力打表。代码如下:#include<...原创 2019-08-05 20:37:23 · 181 阅读 · 0 评论 -
算法训练 数字三角形
题目:(图3.1-1)示出了一个数字三角形。 请编一个程序计算从顶至底的某处的一条路 径,使该路径所经过的数字的总和最大。 ●每一步可沿左斜线向下或右斜线向下走; ●1<三角形行数≤100; ●三角形中的数字为整数0,1,…99; . (图3.1-1)输入格式 文件中首先读到的是三角形的行数。 接下来描述整个三角形输出格式 最大总和(整数)样...原创 2019-03-06 21:02:07 · 207 阅读 · 0 评论 -
N - 跑跑卡丁车
题目:跑跑卡丁车是时下一款流行的网络休闲游戏,你可以在这虚拟的世界里体验驾驶的乐趣。这款游戏的特别之处是你可以通过漂移来获得一种 加速卡,用这种加速卡可以在有限的时间里提高你的速度。为了使问题简单化,我们假设一个赛道分为L段,并且给你通过每段赛道的普通耗时Ai和用加速卡的耗时Bi。加速卡的获得机制是:普通行驶的情况下,每通过1段赛道,可以获得20%的能量(N2O).能量集满后获得一个加速卡(...原创 2018-09-14 20:14:07 · 290 阅读 · 0 评论 -
N - Filthy Rich
题目:They say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonishment you discover that this is to be taken literally: small heaps of gold a...原创 2018-07-19 10:54:21 · 171 阅读 · 0 评论 -
E - How many ways
题目:这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下: 1.机器人一开始在棋盘的起始点并有起始点所标有的能量。 2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。 3.机器人不能在原地停留。 4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。如上图,机器人一开始在(1...原创 2018-07-29 18:57:25 · 185 阅读 · 0 评论 -
D - 最大报销额
题目:现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,其中 Q 是给定的报销额度,N(&l...原创 2018-08-02 11:16:03 · 526 阅读 · 0 评论 -
H - Advanced Fruits
题目:The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn't work, but som...原创 2018-08-03 15:42:47 · 242 阅读 · 0 评论 -
C - 饭卡
题目:电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。 Input多组数据。对于每组数据: 第一行...原创 2018-08-05 19:03:23 · 485 阅读 · 0 评论 -
I - Largest Rectangle in a Histogram
题目:A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left s...原创 2018-08-05 19:51:04 · 251 阅读 · 0 评论 -
F - 数组的最大代价
题目:数组A包含N个元素A1, A2......AN。数组B包含N个元素B1, B2......BN。并且数组A中的每一个元素Ai,都满足1 <= Ai <= Bi。数组A的代价定义如下: (公式表示所有两个相邻元素的差的绝对值之和)给出数组B,计算可能的最大代价S。Input第1行:1个数N,表示数组的长度(1 <= N <= 50000...原创 2018-08-09 19:23:33 · 149 阅读 · 0 评论 -
D - Anniversary party
题目:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms...原创 2018-08-25 20:19:21 · 149 阅读 · 0 评论 -
Milking Time POJ - 3616
题目:Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her nextN(1 ≤N≤ 1,000,000) hours (conveniently labeled 0..N-1) so tha...原创 2019-09-28 15:12:03 · 130 阅读 · 0 评论