贪心
文章平均质量分 89
mowayao
这个作者很懒,什么都没留下…
展开
-
POJ3927 Priest John's Busiest Day
Priest John's Busiest DayTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 533 Accepted: 171DescriptionJohn is the only priest in his town. October 26th i原创 2013-10-02 22:23:19 · 847 阅读 · 0 评论 -
HDU 5047 Sawtooth(有趣的思维题+证明)
SawtoothTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 979 Accepted Submission(s): 375Problem DescriptionThink about a plane原创 2014-09-29 13:41:22 · 1293 阅读 · 0 评论 -
SPOJ 417 The lazy programmer(贪心)
417. The lazy programmerProblem code: LAZYPROGA new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive原创 2014-09-16 15:07:25 · 1202 阅读 · 0 评论 -
HDU4038-Stone(思维题)
StoneTime Limit: 3000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2267 Accepted Submission(s): 568Problem DescriptionGiven an array of int原创 2014-08-18 17:48:23 · 730 阅读 · 0 评论 -
Uva10905 Children's Game
坑题:很容易想错,用的是贪心的思想,对字符串进行排序,输出即可,主要是cmp函数的构造坑点1: 90 和 9#include #include #include #include using namespace std;bool comp(string a,string b){ int i; while(a.size() > b.size()){ for(i = 0;原创 2013-08-05 15:30:16 · 529 阅读 · 0 评论 -
UVa11158 - Elegant Permuted Sum
ENext Generation Contest 3Time Limit: 2 secondsElegant Permuted SumYou will be given n integers A1A2A3...An>. Find a permutation of these n integers so that sum原创 2014-03-26 18:03:03 · 812 阅读 · 0 评论 -
UVa11555 - Aspen Avenue
Aspen Avenue ``Phew, that was the last one!'' exclaimed the garden helper Tim as he threw the last tree plant to the ground. His employer, countess Esmeralda Hunt who owned the estate,原创 2014-03-26 11:34:48 · 929 阅读 · 0 评论 -
UVa11411 - MiniMice
Problem A : MiniMiceTime Limit : 6 secondsWelcome to the world of mice. All mice have IDs. They are numbered orderly according to their seniority from 1. These mice live in groups. Mice of a sam原创 2014-03-25 19:04:57 · 795 阅读 · 0 评论 -
UVa948 - Fibonaccimal Base
Problem C - Fibonaccimal BaseThe well known Fibonacci sequence is obtained by starting with 0 and 1 and then adding the two last numbers to get the next one. For example the third number in the sequ原创 2014-03-18 16:51:51 · 1064 阅读 · 0 评论 -
UVa11751 - Installing Diagnostic Software
Problem J: Installing Diagnostic SoftwareYou have recently been appointed as the administrator for a wired network of devices. Unfortunately, your predecessor used very poor quality lines to conne原创 2014-03-28 15:04:50 · 832 阅读 · 0 评论 -
UVa410 - Station Balance
Station Balance The International Space Station contains many centrifuges in its labs. Each centrifuge will have some number (C) of chambers each of which can contain 0, 1, or 2 specimens.原创 2014-03-11 17:37:35 · 1021 阅读 · 0 评论 -
UVa10720 - Graph Construction
raph ConstructionTime Limit2 SecondsGraph is a collection of edges E and vertices V. Graph has a wide variety of applications in computer. There are different ways to represe原创 2014-03-11 14:17:21 · 820 阅读 · 0 评论 -
UVa993-Product of digits
Product of digits For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N .Input The first line of input contains o原创 2014-03-11 12:57:44 · 813 阅读 · 0 评论 -
UVa10670 - Work Reduction
Problem C: Work ReductionPaperwork is beginning to pile up on your desk, and tensions at the workplace are starting to mount. Your boss has threatened to fire you if you don't make any progress by原创 2014-03-11 15:34:28 · 641 阅读 · 0 评论 -
POJ1700 Crossing River
Crossing RiverTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9830 Accepted: 3709DescriptionA group of N people wishes to go across a river with only one原创 2013-10-20 15:10:36 · 678 阅读 · 0 评论 -
UVa 12589 Learning Vector
题意:有n个向量(0 思路:先确定一点,对于选出的k个向量,按斜率从大到小的顺序摆放,面积最大。(不然会损失几个平行四边形的面积) 然后DP , DP[id][cur][height] 分别表示前id个向量,已经选出了cur个向量,高度为height的最大面积。面积计算公式为 x0*y0 + 2*x1*y0+x1*y1 + 2*x2*(y0+y1)........用记忆化搜索注意初始化的优化原创 2014-10-11 12:23:31 · 1088 阅读 · 0 评论