贪心
文章平均质量分 56
nenu_xlp
钢之心
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2037 今年暑假不AC
贪心算法 最长事件序列问题#include#include#includeusing namespace std;struct tv{ int s; int e;}ti[120];bool cmp(tv a,tv b){ return a.e<b.e;}int main(){ int n; while(scanf("%d",&n)==原创 2013-06-06 10:53:20 · 783 阅读 · 0 评论 -
HDU 4932 Miaomiao's Geometry
答案只可能有两种情况 要么是已知点的距离 要么是已知点距离的一半那么就枚举每个点之间的距离 和距离的一半先把所有点按照升序排序 然后用枚举的值贪心对于点A[i] 如果能放[[A[i]-now,A[i]]就放 否则就放[A[i],A[i]+now]#includeusing namespace std;double a[120],b[120];int main(){原创 2014-08-11 10:45:09 · 733 阅读 · 0 评论 -
Codeforces 444A DZY Loves Physics
If there is a connected induced subgraph containing more than 2 nodes with the maximum density. The density of every connected induced subgraph of it that contains only one edge can be represented a原创 2014-07-11 11:23:59 · 574 阅读 · 0 评论 -
HNU 12848 Energy Tycoon (贪心)
贪心#includeusing namespace std;int main(){ long long n; char s[100020]; while(scanf("%I64d",&n)==1) { scanf("%s",s); int len=strlen(s); long long sum1=0,sum原创 2014-07-29 10:18:26 · 814 阅读 · 0 评论 -
HDU 4882 ZCC Loves Codefires (贪心)
贪心原创 2014-07-25 10:17:32 · 583 阅读 · 0 评论 -
ZOJ 3721 Final Exam Arrangement (贪心)
按每场考试开始的时间排序后贪心原创 2014-07-25 16:02:22 · 580 阅读 · 0 评论 -
HDU 4726 Kia's Calculation
2013年成都邀请赛K题原创 2014-05-07 14:32:56 · 540 阅读 · 0 评论 -
HDU 1257 最少拦截系统
贪心每次找出最长非减zi原创 2014-05-05 19:50:27 · 486 阅读 · 0 评论 -
Codeforces 416C Booking System
贪心从小桌子开始每一步都选择收益大的原创 2014-05-03 19:58:03 · 733 阅读 · 0 评论 -
HDU 1789 Doing Homework again
贪心从后往前每天完成原创 2014-05-03 19:42:24 · 568 阅读 · 0 评论 -
Codeforces 458B Distributed Join
题目没看懂 数据库什么的。。照着样例直接贪心居然又AC了。。#includeusing namespace std;long long a[100020],b[100020];int main(){ int m,n; scanf("%d%d",&m,&n); long long sum1=0,sum2=0,s1=0,s2=0,Max1=0,Max2=0;原创 2014-08-11 11:10:50 · 1417 阅读 · 1 评论
分享