
c++ 贪心
碳酸钙的01妖精
这个作者很懒,什么都没留下…
展开
-
HDU-1257 最少拦截系统
HDU-1257 最少拦截系统最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 54683 Accepted Submission(s): 21427Problem Description某国为了防御敌国的导弹袭击,发展出一...原创 2018-07-13 11:41:58 · 134 阅读 · 0 评论 -
贪心区间问题 (白皮书例题2)
//区间调度问题:结束时间越早之后可选的工作也就越多。 //证明: /* 与其他选择方案相比,该算法的选择方案在选取了相同数量的更早数量的更早开始工作时, 其最终结束时间不会比其他方案的更晚 */ #include <iostream> #include <algorithm> using namespace std; #define MAXN...原创 2018-08-05 18:12:17 · 147 阅读 · 0 评论 -
贪心-硬币问题(白皮书例1)
//硬币问题 #include <cstdio> #include <iostream> using namespace std; const int V[6]={1,5,10,50,100,500}; int C[6]; int A; int main() { int i; int ans=0; for(i=5;i>=0;i--) //...原创 2018-08-05 18:52:28 · 546 阅读 · 0 评论 -
POJ-3617 Best Cow Line(贪心)
Best Cow Line Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 32406 Accepted: 8587 Description FJ is about to take his N (1 ≤ N ≤ 2,000) co...原创 2018-08-05 22:07:12 · 211 阅读 · 0 评论 -
POJ-3069 Saruman's Army(贪心)
Saruman's Army Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14056 Accepted: 7053 Description Saruman the White must lead his army along a straight path from Isengar...原创 2018-08-06 08:46:13 · 124 阅读 · 0 评论 -
贪心小结
贪心法就是遵循某种规则,不断贪心地选取当前最优策略的算法设计方法原创 2018-08-06 16:26:45 · 232 阅读 · 0 评论 -
Escape Room (贪心)
Escape Room 利用 贪心排序,利用id还原真的是6 这结构体的x,y也用的很巧妙 #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; #define MAXN 100010 struct Node { int x,y; ...原创 2018-08-26 19:44:17 · 322 阅读 · 0 评论 -
Binary Transformation(贪心 1 1)
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define MAXN 100010 #define MAXM 5010 long long c[MAXN]; int n,cnt; char a[MAXN],b[MAXN...原创 2018-08-27 20:14:17 · 457 阅读 · 0 评论 -
贪心原理
当前状态下的最好选择。 贪心可以理解为是一维状态下的层进原创 2019-01-20 14:45:14 · 196 阅读 · 0 评论