![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心算法
文章平均质量分 50
sdau20163940
努力学习,天天向上!
展开
-
leetcode 564. 寻找最近的回文数(贪心+模拟)
贪心原创 2022-03-02 12:51:54 · 617 阅读 · 0 评论 -
Cleaning Shifts(贪心算法)
Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T原创 2017-08-16 15:34:10 · 395 阅读 · 0 评论 -
Cow Acrobats(贪心)
题意:有N头牛叠罗汉,对于每头牛定义一个难受值,这个值等于在它上面的所有奶牛的体重减去它的力量。让你求一种排序方法使所有牛的难受值最小,题目让我们输出这个排序中最大得一头牛的难受值。 思路: 一开始想的用二分,但是没有思路。后来想到了贪心,可是如何贪呢?是以体重还是力量这个问题纠结了好久。。。不难发现,如果体重越大,力量越大,越在下面那么相应的值也就越小,因此我们以他们的和排序,大的在下面,然原创 2017-08-17 19:21:27 · 560 阅读 · 0 评论 -
T - 20
Description A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square原创 2017-04-23 12:36:26 · 257 阅读 · 0 评论 -
Muddy roads(贪心)
Muddy roads Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3288 Accepted: 1511 Description Farmer John has a problem: the dirt road from his farm to tow原创 2017-08-22 22:43:51 · 383 阅读 · 0 评论 -
Problem H: 周老师的区间问题(贪心)
Problem H: 周老师的区间问题 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 1034 Solved: 132 Status Description 周老师无聊时乱写了 n 个区间,但处女座的他随后又想将 n 个区间整理合并,但他发现区间太多了,于是他想请你帮帮他 Input原创 2017-12-27 14:46:42 · 534 阅读 · 0 评论 -
Hello 2018(B、C)
B. Christmas Spruce time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Consider a rooted tree. A rooted tree ha原创 2018-01-09 10:44:40 · 569 阅读 · 0 评论 -
D. Too Easy Problems(贪心)
D. Too Easy Problems time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are preparing for an exam on sched原创 2018-01-09 15:51:58 · 586 阅读 · 1 评论