
贪心
yjt9299
这个作者很懒,什么都没留下…
展开
-
CodeForces - 733D Kostya the Sculptor
D. Kostya the Sculptortime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputKostya is a genial sculptor, he has原创 2017-08-28 19:58:08 · 338 阅读 · 0 评论 -
hdu 5527 (贪心)
一个比较好的贪心题 : http://acm.hdu.edu.cn/showproblem.php?pid=5527思路: 对于这个题比较难的点就是在 50 和 500 的处理上,因为如果没有50 和 500 的钱币 ,那么其他的钱币就是相互对立的。我就可以直接贪心的来找了。在这里处理的时候,我可以把 两张50的看成 1张100 的,500 同理。那么我考虑反方向也就是求 所有钱的价值- 我...原创 2018-08-31 16:23:40 · 508 阅读 · 0 评论 -
hdu 6326 Problem H. Monster Hunter(贪心+并查集)
Problem H. Monster HunterTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 663 Accepted Submission(s): 158 Problem DescriptionLittle ...原创 2018-08-03 16:54:58 · 590 阅读 · 1 评论 -
zoj 3963 Heap Partition
A sequence S = {s1, s2, ..., sn} is called heapable if there exists a binary tree Twith n nodes such that every node is labelled with exactly one element from the sequence S, and for every non-root no...原创 2018-03-28 10:31:41 · 141 阅读 · 0 评论 -
codeforces Riverside Curio
C. Riverside Curiotime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputArkady decides to observe a river for n consecutive days. The river's water level...原创 2018-04-02 18:35:53 · 307 阅读 · 0 评论 -
天梯L3 17 森森快递 贪心+线段树
L3-017. 森森快递时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者俞勇(上海交通大学)森森开了一家快递公司,叫森森快递。因为公司刚刚开张,所以业务路线很简单,可以认为是一条直线上的N个城市,这些城市从左到右依次从0到(N-1)编号。由于道路限制,第i号城市(i=0, ..., N-2)与第(i+1)号城市中间往返的运输货物重量在同一时刻不能超过...原创 2018-03-27 14:47:17 · 1180 阅读 · 0 评论 -
Ice Cream Tower The 2016 ACM-ICPC Asia China-Final Contest
挺好的一个二分加贪心的题目 。。 思想虽然不是很难,但是 也许还可以。题意: 题目含义就类似于堆雪人堆蛋糕,,要求下一层至少是上一层的两倍。 给你一个k 表示层数 给你n个 数 表示每一层的大小 问你最多能堆成几个k层的 雪人。 思路: 最少堆成 0个 最多堆成 n/k 个。(二分 n/k ) 如果将最大堆成n个 会超时。 剩下的就是贪心的过程 , 给你一个原创 2017-11-07 14:24:03 · 346 阅读 · 0 评论 -
POJ 3617(贪心)
Best Cow LineTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26621 Accepted: 7215DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual原创 2017-10-09 18:32:52 · 373 阅读 · 0 评论 -
CodeForces - 540B School Marks
B. School Markstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Vova studies programming in an elite原创 2017-09-21 10:53:42 · 232 阅读 · 0 评论 -
CodeForces - 747D Winter Is Coming
D. Winter Is Comingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe winter in Berland lasts n days. For原创 2017-09-10 20:27:33 · 281 阅读 · 0 评论 -
51Nod - 1420 数袋鼠好有趣
有n只袋鼠。每只袋鼠的大小用一个整数表示。一只小袋鼠能装进一只大袋鼠的条件是,大袋鼠的大小至少是小袋鼠的两倍。每只大袋鼠最多可以装一只袋鼠。小袋鼠被装进大袋鼠之后就不能再装其它的袋鼠了。小袋鼠被装进大袋鼠之后就不能被我们看见了。请找出一个装袋鼠的方案,使得被看见的袋鼠最少。Input单组测试数据。第一行包含一个整数n(1≤n≤5*10^5)。接下原创 2017-09-10 20:18:29 · 240 阅读 · 0 评论 -
codeforces 1054dD. Changing Array
链接: http://codeforces.com/contest/1054/problem/D题解:https://www.luogu.org/blog/yqtwrzw/cf1054d-ti-xie代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N = 20...原创 2018-10-30 12:21:43 · 192 阅读 · 0 评论