![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
玛珈山大萌新
破山中贼易,破心中贼难。不破不立,破而后立,立而为人。
展开
-
1047 邮票面值设计 1999年NOIP全国联赛提高组
题目描述Description 给定一个信封,最多只允许粘贴N张邮票,计算在给定K(N+K≤40)种邮票的情况下(假定所有的邮票数量都足够),如何设计邮票的面值,能得到最大值MAX,使在1~MAX之间的每一个邮资值都能得到。 例如,N=3,K=2,如果面值分别为1分、4分,则在1分~6分之间的每一个邮资值都能得到(当然还有8分、9分和12分);如果面值分别为1分、3分...原创 2019-07-29 22:33:47 · 126 阅读 · 0 评论 -
dp——问题转化→01背包+滚动数组
题目: Prison rearrangement Time Limit:3000MS Memory Limit:10000K Total Submissions:2194 Accepted:984 Description In order to lower the risk of riots and escape attempts, th...原创 2019-07-20 15:39:10 · 113 阅读 · 0 评论 -
dp——完全背包+大数存储+数论
题目: Least common multiple Partychen like to do mathematical problems. One day, when he was doing on a least common multiple(LCM) problem, he suddenly thought of a very interesting question: if given...原创 2019-07-20 22:45:04 · 160 阅读 · 0 评论 -
LCS——最长公共子串
学习链接LCS 题目链接:Advanced Fruits 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 110; char a[maxn], b[maxn]; typedef pair<int, int> PAIR; int dp[maxn][maxn]; int main()...原创 2019-07-21 20:22:58 · 74 阅读 · 0 评论 -
Jury Compromise POJ - 1015 (二维dp)
在遥远的国家佛罗布尼亚,嫌犯是否有罪,须由陪审团决定。陪审团是由法官从公众中挑选的。先随机挑选n个人作为陪审团的候选人,然后再从这n个人中选m人组成陪审团。选m人的办法是: 控方和辩方会根据对候选人的喜欢程度,给所有候选人打分,分值从0到20。为了公平起见,法官选出陪审团的原则是:选出的m个人,必须满足辩方总分和控方总分的差的绝对值最小。如果有多种选择方案的辩方总分和控方总分的之差的绝对值相同,那...原创 2019-08-05 21:03:20 · 103 阅读 · 0 评论 -
A. Array Without Local Maximums (数位dp)
A. Array Without Local Maximums time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Ivan unexpectedly saw a present from one of his p...原创 2019-08-07 17:03:33 · 144 阅读 · 0 评论 -
Making the Grade POJ3666(dp + 离散化/贪心)
题目: Making the Grade Time Limit:1000MS Memory Limit:65536K Total Submissions:12460 Accepted:5740 Description A straight dirt road connects two fields on FJ's farm, but it ch...原创 2019-08-14 16:23:57 · 107 阅读 · 0 评论 -
洛谷P2516 [HAOI2010]最长公共子序列
https://www.cnblogs.com/liuwenhan/p/11323892.html原创 2019-08-12 22:25:18 · 192 阅读 · 0 评论