基础dp
文章平均质量分 80
还是太年轻
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2577 How to Type
How to TypeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7429 Accepted Submission(s): 3368Problem DescriptionPirates have f原创 2018-01-31 21:58:54 · 132 阅读 · 0 评论 -
ZOJ 4019 Schrödinger's Knapsack(dp+贪心)
Schrödinger's KnapsackTime Limit: 1 Second Memory Limit: 65536 KBDreamGrid has a magical knapsack with a size capacity of called the Schrödinger's knapsack (or S-knapsack for short) and two type...原创 2018-04-08 09:54:26 · 516 阅读 · 0 评论 -
Wannafly挑战赛12 C-删除子串
链接:https://www.nowcoder.com/acm/contest/79/C来源:牛客网题目描述给你一个长度为n且由a和b组成的字符串,你可以删除其中任意的部分(可以不删),使得删除后的子串“变化”次数小于等于m次且最长。 变化:如果a[i]!=a[i+1]则为一次变化。(且新的字符串的首字母必须是'a') 如果初始串全为b,则输出0。输入描述:第一行输入两个数n,m。(1 <=...原创 2018-03-25 20:19:21 · 206 阅读 · 0 评论 -
2018年长沙理工大学第十三届程序设计竞赛 H-数学考试
链接:https://www.nowcoder.com/acm/contest/96/H来源:牛客网题目描述今天qwb要参加一个数学考试,这套试卷一共有n道题,每道题qwb能获得的分数为ai,qwb并不打算把这些题全做完, 他想选总共2k道题来做,并且期望他能获得的分数尽可能的大,他准备选2个不连续的长度为k的区间, 即[L,L+1,L+2,....,L+k-1],[R,R+1,R+2,...,R...原创 2018-04-14 20:05:38 · 496 阅读 · 0 评论 -
埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 L-K序列
链接:https://www.nowcoder.com/acm/contest/91/L来源:牛客网题目描述给一个数组 a,长度为 n,若某个子序列中的和为 K 的倍数,那么这个序列被称为“K 序列”。现在要你 对数组 a 求出最长的子序列的长度,满足这个序列是 K 序列。 输入描述:第一行为两个整数 n, K, 以空格分隔,第二行为 n 个整数,表示 a[1] ∼ a[n],1 ≤ n ≤ 10...原创 2018-04-15 21:04:48 · 268 阅读 · 1 评论 -
POJ 1769 Minimizing maximizer(dp+线段树)
Minimizing maximizerTime Limit: 5000MS Memory Limit: 30000KTotal Submissions: 4669 Accepted: 1909DescriptionThe company Chris Ltd. is preparing a new sorting hardware called Maximizer. Maximizer has n...原创 2018-03-29 11:13:52 · 407 阅读 · 0 评论 -
HDU 6026 Deleting Edges(DAG)
Deleting EdgesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1188 Accepted Submission(s): 420Problem DescriptionLittle Q is crazy about gr...原创 2018-04-22 20:52:51 · 289 阅读 · 0 评论 -
第15届浙江省赛 D Sequence Swapping(dp)
Sequence SwappingTime Limit: 1 Second Memory Limit: 65536 KBBaoBao has just found a strange sequence {<, >, <, >, , <, >} of length in his pocket. As you can see, each element ...原创 2018-04-30 22:10:43 · 296 阅读 · 0 评论 -
第十四届华中科技大学程序设计竞赛决赛同步赛 F-Beautiful Land(超大背包)
链接:https://www.nowcoder.com/acm/contest/119/F来源:牛客网题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. Now HUST got a big land whose capacity is C to plant trees. ...原创 2018-05-09 16:27:28 · 183 阅读 · 0 评论 -
西安电子科技大学第16届程序设计竞赛网络同步赛 E-
链接:https://www.nowcoder.com/acm/contest/107/E来源:牛客网题目描述众所周知,Xieldy最常用的口令是******。 为了改变这一现状,他random了一个01串,并从中截取了一段作为自己的口令。 他选择的口令满足以下条件: 1. 口令串表示的二进制数在十进制下可以被表示为3k(k>=0)。 2. 口令串可以有前导零。 现已经random出了01串...原创 2018-04-21 20:11:55 · 444 阅读 · 0 评论 -
SCU 4440 Rectangle(dp)
Rectanglefrog has a piece of paper divided into nn rows and mm columns. Today, she would like to draw a rectangle whose perimeter is not greater than kk.There are 88 (out of 99) ways when n=m=2,k=6n=m...原创 2018-04-27 00:23:37 · 259 阅读 · 0 评论 -
牛客练习赛17 B-好位置
链接:https://www.nowcoder.com/acm/contest/109/B来源:牛客网题目描述给出两个串s和x 定义s中的某一位i为好的位置,当且仅当存在s的子序列 满足y=x且存在j使得i=kj成立。 问s中是否所有的位置都是好的位置。输入描述:一行两个字符串s,x,这两个串均由小写字母构成。1 <= |s|, |x| <= 200000输出描述:Yes表示是。N...原创 2018-05-06 08:45:29 · 378 阅读 · 0 评论 -
POJ 3280 Cheapest Palindrome(经典dp)
Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions:11351 Accepted: 5407DescriptionKeeping track of all the cows can be a tricky task so原创 2018-01-27 22:03:40 · 193 阅读 · 0 评论 -
POJ 1631 HDU 1950(最长上升子序列问题)
Bridging signalsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions:15119 Accepted: 8182Description'Oh no, they've done it again', cries the chief designer原创 2018-01-28 13:51:40 · 475 阅读 · 0 评论 -
POJ 3903 Stock Exchange(最长上升子序列O(n*logn)解法)
Stock ExchangeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7369 Accepted: 2585DescriptionThe world financial crisis is quite a subject. Some people a原创 2018-01-03 14:11:46 · 213 阅读 · 0 评论 -
POJ 1458 Common Subsequence(最长公共子序列问题)
Common SubsequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions:56465 Accepted: 23531DescriptionA subsequence of a given sequence is the given sequence原创 2018-01-03 08:47:31 · 142 阅读 · 0 评论 -
POJ 2533 Longest Ordered Subsequence(最长上升子序列O(n*n)解法)
Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions:56940 Accepted: 25509DescriptionA numeric sequence of ai is ordered if a1 a2 a原创 2018-01-03 11:02:35 · 185 阅读 · 0 评论 -
2015浙江省赛 D-Beauty of Array
Beauty of ArrayTime Limit: 2 Seconds Memory Limit: 65536 KBEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edw...原创 2018-03-13 23:05:28 · 202 阅读 · 0 评论 -
2015浙江省赛 B-Team Formation
Team FormationTime Limit: 2 Seconds Memory Limit: 131072 KBFor an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his unive...原创 2018-03-13 23:02:31 · 188 阅读 · 0 评论 -
HDU 1257 最少拦截系统
最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 49994 Accepted Submission(s): 19577Problem Description某国为了防御敌国的导弹袭击,发展出原创 2018-02-01 13:29:50 · 102 阅读 · 0 评论 -
HDU 1421 搬寝室
搬寝室Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30355 Accepted Submission(s): 10431Problem Description搬寝室是很累的,xhd深有体会.时间追述原创 2018-02-01 14:08:06 · 124 阅读 · 0 评论 -
HDU 1024 Max Sum Plus Plus
Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33207 Accepted Submission(s): 11817Problem DescriptionNow I原创 2018-02-01 18:19:13 · 142 阅读 · 0 评论 -
HDU 1160 FatMouse's Speed(记录结果的最长上升子序列)
FatMouse's SpeedTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18568 Accepted Submission(s): 8214Special JudgeProblem Descriptio原创 2018-02-02 08:48:04 · 169 阅读 · 0 评论 -
HDU 1422 重温世界杯
重温世界杯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7301 Accepted Submission(s): 2589Problem Description世界杯结束了,意大利人连本带利的收回了法原创 2018-02-02 14:59:10 · 218 阅读 · 0 评论 -
HDU 1300 Pearls
PearlsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2954 Accepted Submission(s): 1483Problem DescriptionIn Pearlania everyb原创 2018-02-02 16:48:58 · 140 阅读 · 0 评论 -
POJ 3176 Cow Bowling(基础dp)
Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:20882 Accepted: 13811DescriptionThe cows don't use actual bowling balls when they go bowling原创 2018-01-27 16:47:51 · 189 阅读 · 0 评论 -
HDU Sumsets
SumsetsTime Limit : 4000/2000ms (Java/Other) Memory Limit : 400000/200000K (Java/Other)Total Submission(s) : 2 Accepted Submission(s) : 1Problem DescriptionFarmer John commanded hi原创 2018-01-27 16:52:56 · 206 阅读 · 0 评论 -
POJ 2385 (Apple Catching)
Apple CatchingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:13791 Accepted: 6724DescriptionIt is a little known fact that cows love apples. Farmer Jo原创 2018-01-27 17:02:44 · 170 阅读 · 0 评论 -
HDU 2844 Coins
CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17231 Accepted Submission(s): 6818Problem DescriptionWhuacmers use coins原创 2018-01-28 08:32:11 · 127 阅读 · 0 评论 -
HDU 1081 To The Max(最大子矩阵和)
To The MaxTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13936 Accepted Submission(s): 6645Problem DescriptionGiven a two-di原创 2018-02-02 09:49:56 · 236 阅读 · 0 评论 -
POJ 3421 X-factor Chains(dp or 素因子分解)
X-factor ChainsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:7875 Accepted: 2505DescriptionGiven a positive integer X, an X-factor chain of length m原创 2018-02-07 10:53:14 · 278 阅读 · 0 评论 -
2012_p3 摆花 (flower.cpp/c/pas)
问题 F: 2012_p3 摆花 (flower.cpp/c/pas)时间限制: 1 Sec 内存限制: 128 MB提交: 16 解决: 9[提交][状态][讨论版][命题人:外部导入]题目描述 3.摆花(flower.cpp/c/pas)【问题描述】小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共 m 盆。通过调查顾客的喜好,小明列出了顾客最喜欢的 n 种花,从 1 到 n ...原创 2018-03-15 22:52:16 · 1156 阅读 · 0 评论 -
山区建小学(dp)
问题 J: 山区建小学时间限制: 1 Sec 内存限制: 128 MB提交: 15 解决: 3[提交][状态][讨论版][命题人:quanxing]题目描述政府在某山区修建了一条道路,恰好穿越总共m个村庄的每个村庄一次,没有回路或交叉,任意两个村庄只能通过这条路来往。已知任意两个相邻的村庄之间的距离为di(为正整数),其中,0<i<m。为了提高山区的文化素质,政府又决定从m个村中选...原创 2018-03-16 14:34:31 · 510 阅读 · 0 评论 -
codeforces 33C Wonderful Randomized Sum
C. Wonderful Randomized Sumtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLearn, learn and learn again — Valera has to do this every day. He is s...原创 2018-03-22 21:19:50 · 299 阅读 · 0 评论 -
2015 ACM Amman Collegiate Programming Contest L. Alternating Strings II(dp+线段树)
#include<bits/stdc++.h>using namespace std;char t[100003];int dp[100003];struct node{ int left,right,mid; int x;}tree[400004];void build(int l,int r,int rt){ tree[rt].left=l;...原创 2018-06-01 22:42:54 · 212 阅读 · 0 评论
分享