码迷,mamicode.com
首页 >  
搜索关键字:贪心 区间覆盖    ( 7804个结果
poj3465(贪心+优先队列)
Battle Time Limit: 2000MS   Memory Limit: 131072K Total Submissions: 1851   Accepted: 455 Description You're Zhu Rengong, a formidable hero. After a number of challenging...
分类:其他好文   时间:2014-10-13 13:44:39    阅读次数:215
2014牡丹江区域赛K(贪心)ZOJ3829
Known Notation Time Limit: 2 Seconds      Memory Limit: 131072 KB Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also kn...
分类:其他好文   时间:2014-10-13 12:54:49    阅读次数:152
zoj 3829 Known Notation(贪心)
题目链接:zoj 3829 Known Notation 题目大意:给定一个不完整的后缀表达式,要求有2种不同操作,用尽量少的操作使得表达式完整。 解题思路:贪心,数字的个数要要保证比?的个数多1,不够的话优先补在开头是最优的。然后遍历一遍字符串,碰到数字+1,碰到?-1,保证数字的个数大于等1,如果不够减的话,可以和最后面的一个数字交换位置(用栈维护十分方便),因为添加和交换代价都是...
分类:其他好文   时间:2014-10-13 12:15:49    阅读次数:157
[贪心+模拟] zoj 3829 Known Notation
题目链接: Known Notation Time Limit: 2 Seconds      Memory Limit: 65536 KB Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It...
分类:其他好文   时间:2014-10-12 22:26:48    阅读次数:250
uva 10026 Shoemaker's Problem
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=967对价钱与天数比例排序,贪心即可。 1 #include 2 #include 3 #include .....
分类:其他好文   时间:2014-10-12 21:40:38    阅读次数:256
zoj 3829 Known Notation
题目链接:zoj 3829 Known Notation作者:jostree 转载请说明出处使用贪心+模拟。由于没有数字之间没有空格,因此该题有如下性质:1.如果该字符串全部为数字,则无需操作,直接输出0。2.连续的n个数字后面接连续的m个*,当n>m时,一定是有效的答案。从而最终的目的就是把最后的...
分类:其他好文   时间:2014-10-12 20:53:48    阅读次数:178
uva 10020 Minimal coverage
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=961贪心,排序,对左端点贪,找最大右端点。 1 #include 2 #include 3 #inclu.....
分类:其他好文   时间:2014-10-12 16:22:08    阅读次数:179
hdu 3697 Selecting courses (暴力+贪心)
Selecting courses Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 62768/32768 K (Java/Others) Total Submission(s): 1856    Accepted Submission(s): 469 Problem Description     A new...
分类:其他好文   时间:2014-10-12 14:19:08    阅读次数:205
08day2
引爆炸弹 贪心 【问题描述】 有 n 个炸弹,有些炸弹牵了一根单向引线(也就是说引线只有在这一端能被炸弹点燃),只要引爆了这个炸弹,用引线连接的下一个炸弹也会爆炸。每个炸弹还有个得分,当这个炸弹被引爆后就能得到相应得分。现在要你引爆 k 个炸弹,使得得分最大。 【输入】 第一行两个整数 n、k。 接...
分类:其他好文   时间:2014-10-12 00:24:36    阅读次数:435
UVA1614(贪心)
Hell on the Markets Time Limit:3000MS   Memory Limit:Unknown   64bit IO Format:%lld & %llu [Submit]  [Go Back]  [Status]   Description Most financial institutions had ...
分类:其他好文   时间:2014-10-11 17:11:01    阅读次数:315
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!