
贪心
囿于昼夜one
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #652 (Div. 2) E - DeadLee (贪心)
#include <iostream> #include <cstring> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <map> using namespace std; #define inf 0x7fffffff #define ll long lo.原创 2020-06-30 23:12:24 · 4785 阅读 · 0 评论 -
Codeforces Round #652 (Div. 2) D TediousLee
DP解题思路: 画出leve1~5的图形之后就可以发现,level[i]是由1个level[i-1]和2个level[i-2]再加一个根节点组成的,以level[4]为例:红色的为level[3],绿色的为level[2] 两种比较好的理解方式: #include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; const int m...原创 2020-06-30 23:06:51 · 4764 阅读 · 0 评论 -
最大连续子序列和
下面引入一个编程题理解最大连续子序列和的概念 有一个数组,如1, -5, 8, 3, -4, 15, -8,查找其中连续和最大的相邻串的值。在本例中,最大值为8 + 3 + -4 + 15 = 22. 朴素算法的复杂度为O(n^2),另一种算法如下: 首先假设我们已经找到了最大连续和子串在数组中的起始位置(i)和结束位置(j),其中i <= j,即最大和maxSum = a[i] + a...原创 2020-01-11 21:38:09 · 381 阅读 · 0 评论 -
BAPC 2018 F Financial Planning
** BAPC 2018 F Financial Planning(二分+贪心) ** Description Being a responsible young adult, you have decided to start planning for retirement. Doing some back-of-the-envelope calculations, you figured ou...原创 2019-08-24 20:42:39 · 547 阅读 · 0 评论 -
2018 宁夏邀请赛 H Fight Against Monsters
** 2018 宁夏邀请赛 H Fight Against Monsters(贪心) ** Description It is my great honour to introduce myself to you here. My name is Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden ...原创 2019-08-31 12:17:24 · 329 阅读 · 0 评论 -
HDU - 6709 Fishing Master(2019中国大学生程序设计竞赛(CCPC) - 网络选拔赛)
Fishing Master(贪心) Heard that eom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER’s apprentice, you should pass the trial. So when you f...原创 2019-09-11 21:16:45 · 257 阅读 · 0 评论