动态规划
天夏123
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #336 (Div. 2)-C. Chain Reaction
原题链接C. Chain Reactiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n beacons l原创 2016-08-26 16:39:14 · 472 阅读 · 0 评论 -
51nod-1241 特殊的排序
原题链接1241 特殊的排序题目来源: 摩根斯坦利的比赛题基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注一个数组的元素为1至N的整数,现在要对这个数组进行排序,在排序时只能将元素放在数组的头部或尾部,问至少需要移动多少个数字,才能完成整个排序过程?例如:2原创 2016-11-05 13:28:28 · 266 阅读 · 0 评论 -
Good Bye 2015-D. New Year and Ancient Prophecy
原题链接D. New Year and Ancient Prophecytime limit per test2.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputLimak is a lit原创 2016-10-15 15:56:30 · 302 阅读 · 0 评论 -
51nod-1478 括号序列的最长合法子段
原题链接1478 括号序列的最长合法子段题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注这里有另一个关于处理合法的括号序列的问题。如果插入“+”和“1”到一个括号序列,我们能得到一个正确的数学表达式,我们就认为这个括号序列是合原创 2016-09-29 20:52:21 · 412 阅读 · 0 评论 -
Codeforces Round #334 (Div. 2)-C. Alternative Thinking
原题链接C. Alternative Thinkingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputKevin has just recevied h原创 2016-10-17 15:29:42 · 206 阅读 · 0 评论 -
Codeforces Round #237 (Div. 2)-D. Minesweeper 1D
原题链接D. Minesweeper 1Dtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputGame "Minesweeper 1D" is played原创 2016-10-17 19:03:07 · 304 阅读 · 0 评论 -
51nod-1406 与查询
原题链接1406 与查询题目来源: CodeForces基准时间限制:2 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注有n个整数。输出他之中和x相与之后结果为x的有多少个。x从0到1,000,000Input第一行输入一个整数n。(1<=n<=1,00原创 2016-11-08 10:38:02 · 291 阅读 · 0 评论 -
51nod-1453 抽彩球
原题链接1453 抽彩球题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注一个袋子中有n个彩球,他们用k种不同的颜色染色。颜色被从1到k编号。同一种颜色的球看成是一样的。现在从袋中一个一个的拿出球来,直到拿完所有的球。对于所有颜色为i原创 2016-11-08 14:38:01 · 285 阅读 · 0 评论 -
Codeforces Round #302 (Div. 2)-C. Writing Code
原题链接C. Writing Codetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProgrammers working on原创 2016-10-28 12:36:36 · 245 阅读 · 0 评论 -
51nod-1670 打怪兽
原题链接1670 打怪兽题目来源: 原创基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注lyk在玩一个叫做“打怪兽”的游戏。游戏的规则是这样的。lyk一开始会有一个初始的能量值。每次遇到一个怪兽,若lyk的能量值>=怪兽的能量值,那么怪兽将会被打败,lyk的能量原创 2016-10-05 09:43:24 · 476 阅读 · 0 评论 -
51nod-1274 最长递增路径
原题链接1274 最长递增路径题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注一个无向图,可能有自环,有重边,每条边有一个边权。你可以从任何点出发,任何点结束,可以经过同一个点任意次。但是不能经过同一条边2次,并且你走过的路必须满足所有边的权原创 2016-11-04 22:18:28 · 555 阅读 · 0 评论 -
Codeforces Round #266 (Div. 2)-D. Increase Sequence
原题链接D. Increase Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeter has a sequenc原创 2016-10-25 10:19:38 · 261 阅读 · 0 评论 -
Codeforces Round #293 (Div. 2)-D. Ilya and Escalator
原题链接D. Ilya and Escalatortime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIlya got tired of原创 2016-10-13 21:44:15 · 233 阅读 · 0 评论 -
51nod-1201 整数划分
原题链接1201 整数划分基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} {1,5} {2,4} {1,2,3},共4种。由于数据较大,输出Mod 10^9 + 7的结果即可。原创 2016-10-08 23:01:45 · 387 阅读 · 0 评论 -
Codeforces Round #323 (Div. 1)-B. Once Again...
原题链接B. Once Again...time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of positiv原创 2016-09-07 11:25:20 · 295 阅读 · 0 评论 -
Codeforces Round #287 (Div. 2)-D. The Maths Lecture(数位dp)
原题链接D. The Maths Lecturetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr doesn't like Ma原创 2016-09-23 23:12:05 · 402 阅读 · 0 评论 -
51nod-1405 树的距离之和
原题链接1405 树的距离之和基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注给定一棵无根树,假设它有n个节点,节点编号从1到n, 求任意两点之间的距离(最短路径)之和。Input第一行包含一个正整数n (n <= 100000),表示节点个数。后面(原创 2016-10-10 22:21:57 · 308 阅读 · 0 评论 -
hdoj-5904 LCIS
原题链接LCISTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 444 Accepted Submission(s): 203Problem DescriptionAlex has two原创 2016-09-25 15:47:46 · 390 阅读 · 0 评论 -
Codeforces Round #326 (Div. 1)-B. Duff in Beach
原题链接B. Duff in Beachtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile Duff was resting in the be原创 2016-10-11 15:20:10 · 252 阅读 · 0 评论 -
hdoj-5903 Square Distance
原题链接Square DistanceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 245 Accepted Submission(s): 83Problem DescriptionA原创 2016-09-26 22:08:35 · 236 阅读 · 0 评论 -
51nod-1020 逆序排列
原题链接1020 逆序排列基准时间限制:2 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,原创 2016-11-03 16:10:03 · 743 阅读 · 0 评论 -
Codeforces Round #343 (Div. 2)-C. Famil Door and Brackets
原题链接C. Famil Door and Bracketstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs Famil Door’s birthd原创 2016-10-13 11:15:08 · 224 阅读 · 0 评论 -
hdoj5965-扫雷
原题链接异或密码Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 496 Accepted Submission(s): 171Problem Description晨晨在纸上写了一个长度为N原创 2016-11-09 22:51:18 · 312 阅读 · 0 评论 -
Codeforces Round #294 (Div. 2)-D. A and B and Interesting Substrings
原题链接D. A and B and Interesting Substringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA原创 2016-10-06 17:19:23 · 239 阅读 · 0 评论 -
51nod-1424 零树
原题链接1424 零树题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注有一棵以1为根的树,他有n个结点,用1到n编号。第i号点有一个值vi。现在可以对树进行如下操作:步骤1:在树中选一个连通块,这个连通块必须包含1这个原创 2017-01-10 00:50:26 · 559 阅读 · 0 评论 -
Codeforces457-D. CGCDSSQ
原题链接D. CGCDSSQtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiven a sequence of integers原创 2017-02-18 10:27:14 · 429 阅读 · 0 评论 -
51nod-1603 限高二叉排列树
原题链接1603 限高二叉排列树题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注作为游戏魔方的编写者和管理员,Bob在很多主存模块中检测游戏魔方,并且Bob从未被用户打败,同时他也经常和游戏魔方作战。然而,不愉快的事情原创 2017-01-21 13:18:41 · 439 阅读 · 0 评论 -
Codeforces Round #393 (Div. 2)-D. Travel Card
原题链接D. Travel Cardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA new innovative ticketing systems原创 2017-01-23 13:16:08 · 678 阅读 · 0 评论 -
Codeforces768C-Jon Snow and his Favourite Number
原题链接C. Jon Snow and his Favourite Numbertime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJo原创 2017-02-21 22:36:27 · 545 阅读 · 0 评论 -
Educational Codeforces Round 17-D. Maximum path
原题链接D. Maximum pathtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rectangular table原创 2017-01-28 18:43:34 · 643 阅读 · 0 评论 -
Educational Codeforces Round 19-E. Array Queries
原题链接E. Array Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputa is an array of n pos原创 2017-05-07 17:03:32 · 299 阅读 · 0 评论 -
Codeforces Round #221 (Div. 2)-D. Maximum Submatrix 2
原题链接D. Maximum Submatrix 2time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are give原创 2017-05-09 11:04:17 · 351 阅读 · 0 评论 -
Codeforces Round #277.5 (Div. 2)-F. Special Matrices
原题链接F. Special Matricestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn n × n square matrix is spec原创 2017-05-19 15:44:33 · 325 阅读 · 0 评论 -
Codeforces Round #374 (Div. 2)-C. Journey
原题链接C. Journeytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Irina arrived to on原创 2016-12-29 21:17:51 · 289 阅读 · 0 评论 -
51nod-1737 配对
原题连接1737 配对基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注给出一棵n个点的树,将这n个点两两配对,求所有可行的方案中配对两点间的距离的总和最大为多少。Input一个数n(1<=n<=100,000,n保证为偶数)接下来n-1行每行三个数x,原创 2017-01-03 12:13:30 · 582 阅读 · 0 评论 -
Codeforces Round #301 (Div. 2)-D. Bad Luck Island(概率dp)
原题链接D. Bad Luck Islandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Bad Luck Island原创 2017-01-02 22:47:46 · 288 阅读 · 0 评论 -
Codeforces Round #274 (Div. 2)-E. Riding in a Lift
原题链接E. Riding in a Lifttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputImagine that you are in a bui原创 2016-10-19 17:27:46 · 333 阅读 · 0 评论 -
51nod-1084 矩阵取数问题 V2
原题链接1084 矩阵取数问题 V2基准时间限制:2 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注一个M*N矩阵中有不同的正整数,经过这个格子,就能获得相应价值的奖励,先从左上走到右下,再从右下走到左上。第1遍时只能向下和向右走,第2遍时只能向上和向左走。两次如果经过同一个格子,则该格子的奖原创 2016-10-07 00:14:36 · 259 阅读 · 0 评论 -
Codeforces Round #FF (Div. 2)-C. DZY Loves Sequences
原题链接C. DZY Loves Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDZY has a sequenc原创 2016-10-29 17:57:07 · 323 阅读 · 0 评论 -
51nod-1055 最长等差数列
原题链接1055 最长等差数列基准时间限制:2 秒 空间限制:262144 KB 分值: 80 难度:5级算法题 收藏 关注N个不同的正整数,找出由这些数组成的最长的等差数列。例如:1 3 5 6 8 9 10 12 13 14等差子数列包括(仅包括两项的不列举)1 3 51 5 9 13原创 2016-10-07 21:04:38 · 481 阅读 · 2 评论
分享