![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
Yo3ngLau
Grazie
展开
-
1007 Maximum Subsequence Sum (25分)
1007 Maximum Subsequence Sum (25分)解题思想AC代码#include <iostream>#include <cstdio>using namespace std;int arr[10010];int tmphead, head, tail, Max, sum;bool flag = true;void MCAS(int a...原创 2019-12-06 22:24:29 · 65 阅读 · 0 评论 -
1040 Longest Symmetric String (25 分)
1040 Longest Symmetric String (25 分)思想求给定串最长回文子串长度跑一下Manacher算法到这里讲解结束AC代码#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace st...原创 2019-11-03 22:06:22 · 81 阅读 · 0 评论 -
E - Treats for the Cows
E - Treats for the Cows题目入口:https://vjudge.net/contest/330469#problem/EPOJ入口:Treats for the CowsAC代码#include <iostream>#include <cstdio>#include <algorithm>#include <cstrin...原创 2019-10-07 16:02:10 · 76 阅读 · 0 评论 -
D - Doing Homework
D - Doing Homework题目入口:D - Doing Homework杭电入口:Doing Homework参考网站:https://blog.csdn.net/qq_37605573/article/details/78358865解题思路题意:有n个学科的作业要做 每一科都有自己的截止时间以及消耗时间 超期一天扣一分 求完成所有作业最少扣分思路:Obj结构体用于存放每一...原创 2019-09-23 13:34:24 · 203 阅读 · 0 评论 -
H - Tickets
H - Tickets题目入口:H - Tickets杭电入口:Tickets参考网站:https://blog.csdn.net/qq_40912854/article/details/81490323AC代码#include <iostream>#include <cstring>#include <algorithm>#define mm(...原创 2019-09-21 22:46:05 · 81 阅读 · 0 评论 -
G - 免费馅饼
G - 免费馅饼题目入口:G - 免费馅饼杭电入口:免费馅饼AC代码#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>using namespace std;int mmax(int a, int b, int c){ retu...原创 2019-09-21 22:01:34 · 146 阅读 · 0 评论 -
A - Max Sum Plus Plus
A - Max Sum Plus Plus题目入口:A - Max Sum Plus PlusAC代码#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#define inf 0x3f3f3f3fusing namespace std;...原创 2019-09-21 22:01:25 · 132 阅读 · 0 评论 -
K - The Number of Products
K - The Number of Products题目入口:K - The Number of ProductsCodeforces:B. The Number of Products参考网站:https://www.cnblogs.com/Tianwell/p/11530761.htmlhttps://blog.csdn.net/weixin_43870697/article/det...原创 2019-09-21 22:01:09 · 399 阅读 · 0 评论 -
L - Make The Fence Great Again
L - Make The Fence Great Again题目入口:L - Make The Fence Great Again参考网站:https://blog.csdn.net/tomjobs/article/details/101074229https://blog.csdn.net/weixin_43826249/article/details/101100804https:/...原创 2019-09-21 22:00:48 · 243 阅读 · 0 评论 -
F - Piggy-Bank
F - Piggy-Bank题目入口:F - Piggy-Bank杭电入口:Piggy-Bank解题思路t组测试样例e为空猪重量 f为实猪重量 lim = f-e为给定硬币最终重量n种硬币不限数量(这里要想到完全背包) wei[]存放硬币重量 val[]存放硬币币值dp[i]为达到重量i所需要的硬币最小价值 所以未放入硬币前这里我们初始化为无穷大inf当然dp[0] = 0接下...原创 2019-09-21 10:55:42 · 129 阅读 · 0 评论 -
B - Ignatius and the Princess IV
B - Ignatius and the Princess IV题目入口:B - Ignatius and the Princess IV杭电入口:Ignatius and the Princess IV解题思路题目:给一列数,找出出现(n+1)/2次的数字第二个代码为直接模拟 过掉不说第一个代码的巧妙之处设一个标志 通过输入更新标志 如果输入的数和前边的数不同就–cnt 否则++c...原创 2019-09-21 10:44:57 · 325 阅读 · 1 评论 -
Monkey and Banana
Monkey and Banana题目入口:Monkey and Banana杭电入口:Monkey and Banana解题思路n种砖块不限数量底面对应边严格更小的砖块才可向上堆积每个砖块有6种不同堆积方法但可理解为3种(另外3种效果相同)多组测试样例 以n==0终止注意答案输出格式 cnt用来辅助答案输出以下是重点部分:首先用结构体存放一种砖块的三边每输入一类砖块的三边将...原创 2019-09-21 10:14:03 · 132 阅读 · 0 评论 -
E - Super Jumping! Jumping! Jumping!
E - Super Jumping! Jumping! Jumping!题目入口:E - Super Jumping! Jumping! Jumping!杭电入口:Super Jumping! Jumping! Jumping!解题思路测试样例:多组样例 以N==0结束规则:每次只能跳到更大的数字上求解:最大得分已知:棋子数N<=1000用a[1010]存放棋子模型定位:最...原创 2019-09-21 09:53:33 · 317 阅读 · 0 评论 -
J - FatMouse's Speed
J - FatMouse’s Speed题目入口:J - FatMouse’s Speed解题思路这道题要求我们排出最大的体重越来越大速度越来越慢的老鼠序列.首先我们需要一个结构体存放每个老鼠的信息体重 速度 编号一个带自定义cmp函数的sort函数排出按体重升序的顺序(这里注意如果体重相等,则让速度快的排前面)好了 现在我们开始dp对于一只老鼠1,我们看它后面体重比它大速度比它慢...原创 2019-09-20 13:11:57 · 401 阅读 · 0 评论 -
I - 最少拦截系统
I - 最少拦截系统题目入口:I - 最少拦截系统解题思路第一遍遍历前推WA了(很多人想知道为什么会错)找到题目里的坑就豁然开朗了虽然是导弹依次飞来但是后面发射的导弹可以选择前面已用过的拦截系统进行拦截这里给一个拆分例子理解一下示例:8 389 207 155 300 299 170 158 65389 207 155 65300 399 170 158这个样例显然不明显...原创 2019-09-20 12:50:15 · 260 阅读 · 1 评论