贪心
文章平均质量分 89
mowayao
这个作者很懒,什么都没留下…
展开
-
POJ3927 Priest John's Busiest Day
Priest John's Busiest Day Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 533 Accepted: 171 Description John is the only priest in his town. October 26th i原创 2013-10-02 22:23:19 · 821 阅读 · 0 评论 -
HDU 5047 Sawtooth(有趣的思维题+证明)
Sawtooth Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 979 Accepted Submission(s): 375 Problem Description Think about a plane原创 2014-09-29 13:41:22 · 1264 阅读 · 0 评论 -
SPOJ 417 The lazy programmer(贪心)
417. The lazy programmer Problem code: LAZYPROG A 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 · 1178 阅读 · 0 评论 -
HDU4038-Stone(思维题)
Stone Time Limit: 3000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 2267 Accepted Submission(s): 568 Problem Description Given an array of int原创 2014-08-18 17:48:23 · 709 阅读 · 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 · 511 阅读 · 0 评论 -
UVa11158 - Elegant Permuted Sum
E Next Generation Contest 3 Time Limit: 2 seconds Elegant Permuted Sum You will be given n integers A1A2A3...An>. Find a permutation of these n integers so that sum原创 2014-03-26 18:03:03 · 794 阅读 · 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 · 905 阅读 · 0 评论 -
UVa11411 - MiniMice
Problem A : MiniMice Time Limit : 6 seconds Welcome 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 · 774 阅读 · 0 评论 -
UVa948 - Fibonaccimal Base
Problem C - Fibonaccimal Base The 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 · 1018 阅读 · 0 评论 -
UVa11751 - Installing Diagnostic Software
Problem J: Installing Diagnostic Software You 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 · 811 阅读 · 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 · 968 阅读 · 0 评论 -
UVa10720 - Graph Construction
raph Construction Time Limit 2 Seconds Graph 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 · 792 阅读 · 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 · 793 阅读 · 0 评论 -
UVa10670 - Work Reduction
Problem C: Work Reduction Paperwork 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 · 620 阅读 · 0 评论 -
POJ1700 Crossing River
Crossing River Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9830 Accepted: 3709 Description A group of N people wishes to go across a river with only one原创 2013-10-20 15:10:36 · 663 阅读 · 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 · 1057 阅读 · 0 评论