动归小练(真是不会)
反向爆零直至AK
从零开始的编程生活,枯燥却紧张
展开
-
O - Bone Collector
O - Bone CollectorMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the gra原创 2017-01-10 14:25:10 · 222 阅读 · 0 评论 -
P1439 【模板】最长公共子序列
题目链接: P1439 【模板】最长公共子序列做题真的长知识啊~~~这道题,我服了。 给你n个整数,1-n,给你两种排序,问这两种排序的最长公共子序列有多长。思路:(直接搬过来,我怕我说不好) 看了看其他人写的题解,感觉有点冗杂,我想以最简单,通俗得写一下自己的理解,希望大家能得到我的帮助!首先看到这道题很容易一下就想到dp(n^2),但是看看数据范围,放弃dp,再看一看它题目原创 2018-01-27 14:31:40 · 268 阅读 · 0 评论 -
hdu 6180 Schedule(贪心)
题目链接:传送门ScheduleTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 153428/153428 K (Java/Others) Total Submission(s): 1111 Accepted Submission(s): 449Problem Description There are N schedules原创 2017-09-05 18:37:56 · 287 阅读 · 0 评论 -
hdu 6092 Rikka with Subset(多重背包)
题目链接:这里写链接内容Rikka with SubsetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1647 Accepted Submission(s): 822Problem Description As we know原创 2017-08-17 18:12:09 · 216 阅读 · 0 评论 -
最大和问题(一维数组和二维数组)(dp问题)
dp问题一直是比较头疼的问题,现在介绍两个较为相似的问题;1 .一维的最大和问题:Max Sum HDU - 10032.二维的最大和问题:题目1139:最大子矩阵【一维最大和】以样例讲:给你n个整数,问连续的几个数的和最大是多少?(即最大字串是多少) 该题有几个要求: (1)要求和相同时,取最开始的; (2)须输出起始位置; 输入 0 6原创 2017-07-13 18:08:53 · 781 阅读 · 0 评论 -
F - 游戏人生(区间dp)
游戏人生时间限制: 1000ms内存限制: 128000KB 64位整型: Java 类名:上一题 提交 运行结果 统计 讨论版 下一题题目描述一入宿舍深似海,自此AC是路人,善哉善哉。。。有这样一个游戏:有一排妖怪,每个妖怪都有一个主要攻击值和辅助攻击值,你每次只能攻击一个妖怪,当你攻击一个妖怪时,这只妖怪 很显然的就挂了(要不都没得玩儿了),当然当前妖怪对你造成的伤原创 2017-08-03 08:40:38 · 246 阅读 · 0 评论 -
最长递增子序列 O(NlogN)算法
最长递增子序列 O(NlogN)算法今天回顾WOJ1398,发现了这个当时没有理解透彻的算法。 看了好久好久,现在终于想明白了。 试着把它写下来,让自己更明白。最长递增子序列,Longest Increasing Subsequence 下面我们简记为 LIS。 排序+LCS算法 以及 DP算法就忽略了,这两个太容易理解了。假设存在一个序列d[1..9] = 2 1 5 3 6 4 8 9 7转载 2017-07-24 10:43:06 · 887 阅读 · 0 评论 -
D - 还是回文(区间dp)
D - 还是回文Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmitStatusDescription判断回文串很简单,把字符串变成回文串也不难。现在我们增加点难度,给出一串字符(全部是小写字母),添加或删除一个字符,都会产生一定的花费。那么,将字符串变成回文串的最小花费是多少呢?原创 2017-07-27 10:37:56 · 216 阅读 · 0 评论 -
G - 项链 (区间dp)
原先题目写错了,已改过来了,下面是题目链接:F-游戏人生题目链接:G - 项链G - 项链Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmitStatusDescription在Mars星球上,每个Mars人都随身佩带着一串能量项链。在项链上有N颗能量珠。能量珠是一颗有头标记与尾标记原创 2017-07-28 18:15:12 · 262 阅读 · 0 评论 -
最长公共子序列与最长公共子串以及他们的打印(dp)
1.最长公共子序列:两个序列都出现过并且出现顺序与母串保持一致,我们将其称为公共子序列,最长公共子序列(Longest Common Subsequence, LCS)是其中最长的。c[i,j]=⎧⎩⎨⎪⎪0c[i−1,j−1]+1max(c[i,j−1],c[i−1,j])i=0 or j=0i,j>0 and xi=yji,j>0 and xi≠yj两字符相等时左上角的数原创 2017-01-12 17:28:01 · 375 阅读 · 0 评论 -
H - FatMouse's Speed
H - FatMouse's SpeedFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data a原创 2017-01-12 10:01:39 · 220 阅读 · 0 评论 -
C - Dividing
C - Dividing Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the mar原创 2017-01-12 08:57:48 · 343 阅读 · 0 评论 -
Common Subsequence (dp)
Common SubsequenceA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exis原创 2017-01-11 10:23:08 · 224 阅读 · 0 评论 -
Monkey and Banana
Monkey and Banana A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide原创 2017-01-11 09:42:07 · 367 阅读 · 0 评论 -
D 探 寻 宝 藏(双线程DP)
题目链接:D 探 寻 宝 藏D 探 寻 宝 藏内存限制:64MB 时间限制:1s Special Judge: No题目描述: 传说HMH大沙漠中有一个M*N迷宫,里面藏有许多宝物。某天,Dr.Kong找到了迷宫的地图,他发现迷宫内处处有宝物,最珍贵的宝物就藏在右下角,迷宫的进出口在左上角。当然,迷宫中的通路不是平坦的,到处都是陷阱。Dr.Kong决定让他的机器人卡多去探险。但机...原创 2018-05-11 21:23:26 · 358 阅读 · 0 评论