码迷,mamicode.com
首页 >  
搜索关键字:最下优先队列 赫夫曼树 贪心    ( 7683个结果
HDU4883 TIANKENG’s restaurant 【贪心】
TIANKENG’s restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 324    Accepted Submission(s): 167 Problem Description TIANK...
分类:其他好文   时间:2014-07-28 15:56:23    阅读次数:257
UVA 1511 Soju(贪心)
UVA 1511 Soju 题目链接 题意:给定两个点集,要求两个点集各取一点曼哈顿距离最小值,保证点集1的x都小于0,点集2的x都大于0. 思路:由于x2 > x1所以只要考虑y值,如果一个y比另一个y大,那么就是y1 - y2,否则为y2 - y1,这样一来只要对这两种情况,分别进行两次排序贪心计算即可 代码: #include #include #inclu...
分类:其他好文   时间:2014-07-28 00:14:09    阅读次数:176
hdu 3650 Hot Expo(贪心)
hdu 3650 Hot Expo(贪心)...
分类:其他好文   时间:2014-07-27 23:46:49    阅读次数:322
poj1328Radar Installation(贪心—区间选点)
题目链接: 啊哈哈,点我点我 题目: Radar Installation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 52037   Accepted: 11682 Description Assume the coasting is a...
分类:其他好文   时间:2014-07-27 23:46:29    阅读次数:345
hdu 1598 find the most comfortable road
贪心+并查集fighting~~~~~!! 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define maxn 300 7 #define INF 0x3fffffff 8 int par[maxn]; ...
分类:其他好文   时间:2014-07-27 21:36:35    阅读次数:182
poj 2287 Tian Ji -- The Horse Racing (贪心)
# include # include # include using namespace std; int main() { int n,i,j,k,count; int flag1[1010],flag2[1010],a[1010],b[1010]; while(~scanf("%d",&n),n) { for(i=0;i<n;i++) scanf("%d",&a[...
分类:其他好文   时间:2014-07-27 11:41:45    阅读次数:190
poj Yogurt factory (贪心水题)
# include # include # include using namespace std; int main() { int i,n,s; __int64 sum ; int cost[10010],num[10010]; while(~scanf("%d%d",&n,&s)) { for(i=0;i<n;i++) scanf("%d%d",&cost[i],&...
分类:其他好文   时间:2014-07-27 11:34:02    阅读次数:144
uva10026 - Shoemaker's Problem(贪心)
题目:10026 - Shoemaker's Problem 题目大意:有个鞋匠在同一天接到了一堆的生意。可是他每天只能做一双鞋,给出做每双鞋需要的时间和推辞做鞋的赔偿。问怎样合理的分配才能使得赔偿最小。 解题思路:鞋子编号  要花的时间  需要的赔偿(每天)                       1                    1              ...
分类:其他好文   时间:2014-07-27 11:33:02    阅读次数:194
[ACM] POJ 3270 Cow Sorting (置换,贪心)
Cow Sorting Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5946   Accepted: 2263 Description Farmer John's N (1 ≤ N ≤ 10,000) cows are lined up to be milk...
分类:其他好文   时间:2014-07-27 11:19:42    阅读次数:354
poj 2709 Painter (贪心)
//需要n中普通原料和g ml灰色原料 //每三种不同普通原来各x ml 可以合成 x ml 灰色原料 //问最少需要集组原料 每组各原料50 ml # include # include # include using namespace std; int main() { int i,n,cot,g,a[15],g1,b[15]; while(~scanf("%d",&n),n)...
分类:其他好文   时间:2014-07-27 11:10:12    阅读次数:335
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!