
贪心
eazo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Nastya and Scoreboard(dp+贪心)
Denis, after buying flowers and sweets (you will learn about this story in the next task), went to a date with Nastya to ask her to become a couple. Now, they are sitting in the cafe and finally… Deni...原创 2020-04-26 17:16:14 · 407 阅读 · 0 评论 -
Nonsense Time(LIS)
题目描述You a given a permutation p1,p2,…,pn of size n. Initially, all elements in p are frozen. There will be n stages that these elements will become available one by one. On stage i, the element pki w...原创 2019-08-12 10:51:04 · 221 阅读 · 0 评论 -
String 2019
题目描述Tom has a string containing only lowercase letters. He wants to choose a subsequence of the string whose length is k and lexicographical order is the smallest. It’s simple and he solved it with e...转载 2019-07-28 10:51:54 · 138 阅读 · 0 评论 -
有趣的家庭菜园(贪心 逆序对 树状数组)
题目描述JOI君对家庭菜园感兴趣。他每年在自家的田地中种植一种叫做IOI草的植物。JOI君的田地沿东西方向被划分为N个区域,由西到东标号为1~N。IOI草一共有N株,每个区域种植着一株。在第i个区域种植的IOI草,在春天的时候高度会生长至hi,此后便不再生长。去踏青的JOI君注意到,IOI草的配置与预定的不太一样。IOI草是一种非常依靠阳光的植物,如果某个区域的IOI草的东侧和西侧都有比它高的...原创 2019-05-28 22:15:20 · 315 阅读 · 0 评论 -
Clockwork(贪心)
题目描述Rabbits are small mammals in the family Lep or idae of the or der Lagom or pha. So says Wikipedia.C or rectly. The c or ollary is that they are not b or ing, f or they are all or iginal and well...原创 2019-04-29 23:22:10 · 262 阅读 · 0 评论 -
Canonical Coin Systems(贪心,背包)
题目描述A coin system S is a finite (nonempty) set of distinct positive integers corresponding to coin values, also called denominations, in a real or imagined monetary system. For example, the coin syst...原创 2019-04-15 22:59:42 · 279 阅读 · 0 评论 -
每日一练 19.2.13
NOIP2010普及组 导弹拦截(贪心)题目描述经过11年的韬光养晦,某国研发出了一种新的导弹拦截系统,凡是与它的距离不超过其工作半径的导弹都能够被它成功拦截。当工作半径为0时,则能够拦截与它位置恰好相同的导弹。但该导弹拦截系统也存在这样的缺陷:每套系统每天只能设定一次工作半径。而当天的使用代价,就是所有系统工作半径的平方和。某天,雷达捕捉到敌国的导弹来袭。由于该系统尚处于试验阶段,所以只有...原创 2019-02-13 16:27:55 · 311 阅读 · 0 评论 -
每日一练 2019.2.23
NOIP2015普及组推销员题目描述阿明是一名推销员,他奉命到螺丝街推销他们公司的产品。螺丝街是一条死胡同,出口与入口是同一个,街道的一侧是围墙,另一侧是住户。螺丝街一共有N家住户,第i家住户到入口的距离为Si米。由于同一栋房子里可以有多家住户,所以可能有多家住户与入口的距离相等。阿明会从入口进入,依次向螺丝街的X家住户推销产品,然后再原路走出去。阿明每走1米就会积累1点疲劳值,向第i家住...原创 2019-02-23 00:33:43 · 275 阅读 · 0 评论 -
每日一练 (19.2.8)
【贪心】排座椅(seat)题目描述上课的时候总有一些同学和前后左右的人交头接耳,这是令小学班主任十分头疼的一件事情。不过,班主任小雪发现了一些有趣的现象,当同学们的座次确定下来之后,只有有限的D对同学上课时会交头接耳。同学们在教室中坐成了M行N列,坐在第i行第j列的同学的位置是(i,j),为了方便同学们进出,在教室中设置了K条横向的通道,L条纵向的通道。于是,聪明的小雪想到了一个办法,或许可以...原创 2019-02-08 15:54:37 · 654 阅读 · 0 评论 -
CodeForces-545C:Woodcutters(贪心)
题目描述Little Susie listens to fairy tales before bed every day. Today’s fairy tale was about wood cutters and the little girl immediately started imagining the choppers cutting wood. She imagined the s...原创 2019-01-28 16:20:27 · 468 阅读 · 0 评论 -
HDU 3544 Alice's Game(贪心博弈)
Alice and Bob have got a lot of chocolates. All the chocolates are rectangles of different shapes as X i * Y i.They decide to play an interesting game on the chocolates. They take turns choose a choco...转载 2019-01-19 19:19:20 · 211 阅读 · 0 评论 -
The Child and Toy
On Children’s Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he can’t wait to destroy the toy.The toy consists of n parts and m ropes. Each rope links two p...原创 2019-01-19 15:04:59 · 368 阅读 · 0 评论 -
Stall Reservations POJ 3190
Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A…B (1 <= A <= B <= 1,000,000), which includes both times A...原创 2019-01-19 14:28:04 · 211 阅读 · 0 评论 -
贪心学习笔记
定义:贪心算法(又称贪婪算法)是指,在对问题求解时,总是做出在当前看来是最好的选择。也就是说,不从整体最优上加以考虑,他所做出的是在某种意义上的局部最优解。贪心算法不是对所有问题都能得到整体最优解,关键是贪心策略的选择,选择的贪心策略必须具备无后效性,即某个状态以前的过程不会影响以后的状态,只与当前状态有关。例题一:合并费用问题搬果子题解#include <iostream>...转载 2019-01-19 13:58:42 · 717 阅读 · 0 评论