数据结构:贪心
数据结构:贪心
LSD20164388
如果你过几天就忘了,那么你并没有真正的掌握。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2019-2020 ICPC Southeastern European Regional Programming Contest (SEERC 2019) E. Life Transfer(大模拟)
传送门 题意 给你nnn,kkk表示nnn个人要出去玩,每辆车可以带kkk个人,再给你lc{l_c}lc,pc{p_c}pc,lm{l_m}lm,pm{p_m}pm分别表示开车需要达到的年龄,买一辆车的花费,骑摩托需要达到的年龄,买一辆摩托的花费(摩托不能载人,也就是一辆摩托只能一个人骑着去)。 接下来给你ttt,ddd,表示nnn个人之间可以互相转移年龄,每转移111岁花费为ttt,每个人最多转移ddd岁(一个人的年龄不能低于111岁),最后给你nnn个人的年龄ai{a_i}ai。 也就是说,原创 2020-11-14 12:55:31 · 558 阅读 · 0 评论 -
ZOJ 3984 Graph Generator(2017CCPC秦皇岛 D)可撤销并查集+思维
题目传送门 题意: T组数据,每组数据给你n(<=1e5)个点,m(<=min(1e5,n*(n-1)/2))条无向边,你需要构造一个合法的序列,其中每一项输出三个数: 点x,你选择的点集的大小,然后给出这些点。(初始为空图,之后系统会增加一个新点x,并将x与你给出的这些点所在的连通块的每一个结点连边!) 最后形成题中给你的图。问你是否存在合法方案,如果存在输出Yes和任意一种方案,否则输出No。 思路: 直接正着做找合法序列太难了,我们考虑从原图往下一个一个拆点,拆成一个合原创 2020-06-24 22:07:04 · 527 阅读 · 0 评论 -
Codeforces Round #638 (Div. 2) F. Phoenix and Memory(贪心+线段树)
F. Phoenix and Memory time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Phoenix is trying to take a photo of hisnnfriends with labels1,2,…,n1,2,…,nwho are lined up in a row in a speci...原创 2020-05-08 18:41:09 · 433 阅读 · 0 评论 -
Codeforces Round #637 (Div. 2) - Thanks, Ivan Belonogov! D. Nastya and Scoreboard(贪心+dp)
D. Nastya and Scoreboard time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Denis, who managed to buy flowers and sweets (you will le...原创 2020-04-24 16:29:51 · 564 阅读 · 0 评论 -
Codeforces Round #525 (Div. 2) E. Ehab and a component choosing problem(贪心+树形dp)
E. Ehab and a component choosing problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You're given a tree consisting of nn node...原创 2018-12-12 20:34:41 · 324 阅读 · 0 评论 -
2019年 ACM/ICPC 亚洲区域赛(徐州)网络赛M.Longest subsequence(思维+贪心)
String is a very useful thing and a subsequence of the same string is equally important. Now you have a stringsswith lengthnnand a stringttwith lengthmm. Find out the longest subsequence in th...原创 2019-09-07 20:43:10 · 1783 阅读 · 0 评论 -
ZOJ 4102 Array in the Pocket (贪心)
Array in the Pocket Time Limit:2 Seconds Memory Limit:65536 KB BaoBao has just found an arrayofintegers in his left pocket. As BaoBao is bored, he decides to rearrange it into another arr...原创 2019-05-08 09:13:30 · 983 阅读 · 0 评论 -
ZOJ 3941 Kpop Music Party (贪心+思维+枚举)
Kpop Music Party Time Limit:2 Seconds Memory Limit:65536 KB Marjar University often hosts Kpop music festival. A Kpop music festival will last several days. During a Kpop festival, there will...原创 2019-05-06 17:26:48 · 405 阅读 · 0 评论 -
Northwestern Europe Regional Contest (NWERC) 2018 Kattis - brexitnegotiations (贪心+拓扑排序)
Brexit Negotiations As we all know, Brexit negotiations are on their way—but we still do not know whether they will actually finish in time. The negotiations will take place topic-by-topic. To organ...原创 2019-05-04 09:08:56 · 1066 阅读 · 0 评论 -
Codeforces Round #525 (Div. 2) F. Ehab and a weird weight formula(思维+贪心)
F. Ehab and a weird weight formula time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output You're given a tree consisting of nn nodes. ...原创 2018-12-13 15:41:46 · 430 阅读 · 2 评论 -
CodeForces - 924B Three-level Laser(贪心)
B. Three-level Lasertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn atom of element X can exist in n distinct states with energies E1 < E2 &l...原创 2018-06-07 11:33:45 · 525 阅读 · 0 评论 -
HDU 6000 Wash (双二分+贪心)
Wash Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 64000/64000 K (Java/Others) Total Submission(s): 2613 Accepted Submission(s): 700 Problem Description Mr.Panda is about to engage...原创 2018-10-29 21:45:17 · 717 阅读 · 0 评论 -
ZOJ 3987 Numbers (贪心+JAVA大数)
Numbers Time Limit: 2 Seconds Memory Limit: 65536 KB DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should...原创 2018-10-25 10:11:52 · 404 阅读 · 0 评论 -
2015年ACM/ICPC长春赛区 J题(01字典树)
题目链接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5204 题意: 给你n(n<=1000)个数,让你选三个数a[i],a[j],a[k](i!=j&&i!=k&...原创 2018-09-29 11:02:45 · 435 阅读 · 0 评论 -
HDU 6406 Taotao Picks Apples(贪心枚举+优化+小暴力)
Taotao Picks Apples Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 338 Accepted Submission(s): 87 Problem Description There is an ap...原创 2018-08-15 20:56:26 · 373 阅读 · 0 评论 -
HDU 5353 Average(贪心)
Average Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 3842 Accepted Submission(s): 888Special Judge Problem Description There are n...原创 2018-08-03 09:09:29 · 389 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第四场)G Maximum Mode(思维)
链接:https://www.nowcoder.com/acm/contest/142/G 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K,其他语言262144K 64bit IO Format: %lld 题目描述 The mode of an integer sequence is the value that appears most ...原创 2018-07-28 20:44:10 · 406 阅读 · 0 评论 -
HDU 6299 Balanced Sequence(贪心)
Balanced Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1330 Accepted Submission(s): 321 Problem Description Chiaki has n str...原创 2018-07-24 09:56:46 · 377 阅读 · 0 评论 -
HDU 5303 Delicious Apples(思维)
Delicious Apples Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2804 Accepted Submission(s): 878 Problem Description There are n app...原创 2018-07-16 16:49:58 · 429 阅读 · 0 评论
分享