
贪心
文章平均质量分 83
YOONGI
这个作者很懒,什么都没留下…
展开
-
NYOJ 找点
找点题目描述上数学课时,老师给了LYH一些闭区间,让他取尽量少的点,使得每个闭区间内至少有一个点。但是这几天LYH太忙了,你们帮帮他吗?输入多组测试数据。每组数据先输入一个N,表示有N个闭区间(N≤100)。接下来N行,每行输入两个数a,b(0≤a≤b≤100),表示区间的两个端点。输出输出一个整数,表示最少需要找几个点。原创 2017-11-07 21:44:41 · 196 阅读 · 0 评论 -
Filthy Rich
Filthy Rich They say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonishment you discover that this is to be taken literally: small heaps of...原创 2018-07-14 11:59:16 · 207 阅读 · 0 评论 -
迷瘴
迷瘴 通过悬崖的yifenfei,又面临着幽谷的考验—— 幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处长年不见天日,导致空气中布满了毒素,一旦吸入体内,便会全身溃烂而死。 幸好yifenfei早有防备,提前备好了解药材料(各种浓度的万能药水)。现在只需按照配置成不同比例的浓度。 现已知yifenfei随身携带有n种浓度的万能药水,体积V都相同,浓度则分别为Pi%。并且知道,针对当时...原创 2018-07-14 14:34:42 · 140 阅读 · 0 评论 -
River Hopscotch (二分+贪心)
River HopscotchEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straigh...原创 2018-08-16 17:12:17 · 272 阅读 · 0 评论 -
Yogurt factory (贪心)
Yogurt factoryThe cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such th...原创 2018-08-16 17:42:38 · 851 阅读 · 0 评论 -
POJ1323 Game Prediction(贪心)
Game PredictionSuppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positive integer which is at most N*M. A...原创 2018-08-16 18:31:04 · 588 阅读 · 0 评论 -
Radar Installation(贪心)
Radar InstallationAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installat...原创 2018-08-17 10:03:26 · 481 阅读 · 0 评论 -
Crossing River (贪心)
Crossing RiverA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row th...原创 2018-08-17 10:34:40 · 402 阅读 · 0 评论 -
Cleaning Shifts(贪心)
Cleaning ShiftsFarmer 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 ...原创 2018-08-17 10:51:58 · 405 阅读 · 0 评论 -
Doing Homework again (贪心)
Doing Homework again Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands i...原创 2018-08-17 11:13:55 · 558 阅读 · 0 评论 -
ZOJ - 3689 Digging (背包+贪心)
DiggingWhen it comes to theMaya Civilization, we can quickly remind of a term called the end of the world. It's not difficult to understand why we choose to believe the prophecy (or we just assume...原创 2019-04-10 19:54:27 · 195 阅读 · 0 评论 -
CodeForces - 721D Maxim and Array (贪心思维+模拟)
Maxim and ArrayRecently Maxim has found an array ofnintegers, needed by no one. He immediately come up with idea of changing it: he invented positive integerxand decided to add or subtract it...原创 2019-08-03 11:02:09 · 175 阅读 · 0 评论 -
Repair the Wall
Repair the Wall Long time ago , Kitty lived in a small village. The air was fresh and the scenery was very beautiful. The only thing that troubled her is the typhoon. When the typhoon came, every...原创 2018-07-14 11:48:47 · 141 阅读 · 0 评论 -
Flying to the Mars
Flying to the Mars In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . Finally , PPF decides to attack Kscinow who rulin...原创 2018-07-14 11:33:45 · 122 阅读 · 0 评论 -
NYOJ 会场安排问题
会场安排问题题目描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m每组测试数据的第一行是一个整数n(1随后的n行,每行有两个正整数Bi,E原创 2017-11-07 21:07:04 · 1176 阅读 · 0 评论 -
NYOJ 过河问题
过河问题题目描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的时间。问题是,如何设计一个方案,让这N人尽快过桥。 输入原创 2017-11-07 20:51:30 · 179 阅读 · 0 评论 -
NYOJ +-字符串
+-字符串题目描述Shiva得到了两个只有加号和减号的字符串,字串长度相同。Shiva一次可以把一个加号和它相邻的减号交换。他想知道最少需要多少次操作才能把第一个字符串变换成第二个字符串。你现在要去帮助他完成那个这个问题。输入多组测试数据每组数据有两行,每行包含一个由”+”和”-“最成的字符串。每个子符串长度不超过5000。输出仅一个原创 2017-11-07 20:48:56 · 175 阅读 · 0 评论 -
NYOJ 背包问题
背包问题题目描述现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1输入第一行输入一个正整数n(1<=n<=5),表示有n组测试数据;随后有n测试数据,每组测试数据的第一行有两个正整数s,m(1输出输出每组测试数据中背包内的物品的价值和,每次输出占一行。样例输入复制13 15原创 2017-11-07 11:06:54 · 253 阅读 · 0 评论 -
NYOJ 非洲小孩
非洲小孩题目描述家住非洲的小孩,都很黑。为什么呢?第一,他们地处热带,太阳辐射严重。第二,他们不经常洗澡。(常年缺水,怎么洗澡。)现在,在一个非洲部落里,他们只有一个地方洗澡,并且,洗澡时间很短,瞬间有木有!!(这也是没有的办法,缺水啊!!)每个小孩有一个时间段能够洗澡。并且,他们是可以一起洗的(不管你是男孩是女孩)。那么,什么时间洗澡,谁应该来洗,由谁决定的呢?那必原创 2017-11-07 11:01:10 · 338 阅读 · 0 评论 -
NYOJ喷水装置(一)
题目描述现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以它为中心的半径为实数Ri(0输入第一行m表示有m组测试数据每一组测试数据的第一行有一个整数数n,n表示共有n个喷水装置,随后的一行,有n个实数ri,ri表示该喷水装置能覆盖的圆的半径。输出输出所用装置的个数样例输入复制252 3.2原创 2017-11-06 17:57:14 · 195 阅读 · 0 评论 -
FatMouse' Trade (贪心)
FatMouse' TradeFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J[i...原创 2018-07-14 10:15:46 · 234 阅读 · 0 评论 -
Moving Tables
Moving TablesThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the north side and south side alo...原创 2018-07-14 10:34:43 · 135 阅读 · 0 评论 -
Wooden Sticks
Wooden SticksThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some ...原创 2018-07-14 11:02:35 · 1611 阅读 · 0 评论 -
Tian Ji -- The Horse Racing
Tian Ji -- The Horse Racing Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the kin...原创 2018-07-14 11:16:12 · 1231 阅读 · 0 评论 -
CodeForces - 437C The Child and Toy (贪心)
The Child and ToyOn 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 ofnparts andmropes...原创 2019-07-31 10:36:00 · 405 阅读 · 0 评论