贪心
楚江枫
不忘初心,方得始终
展开
-
【杭电】HDU 1052 Tian Ji -- The Horse Racing
Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26252 Accepted Submission(s): 7735Problem Description Here is a原创 2016-07-22 22:48:43 · 537 阅读 · 0 评论 -
【Codeforces 724 D Dense Subsequence】+ 贪心
D. Dense Subsequence time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputYou are given a string s, consisting of lowercase English lette原创 2017-02-06 21:43:34 · 398 阅读 · 0 评论 -
【Codeforces 712 C. Memory and De-Evolution】+ 贪心
C. Memory and De-Evolution time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Memory is now interested in the de-evolution of objects, specif原创 2017-02-19 16:10:11 · 386 阅读 · 0 评论 -
【Codefoces 722 D Generating Sets】+ 贪心 + map
D. Generating Sets time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputYou are given a set Y of n distinct positive integers y1, y2, …,原创 2017-02-10 16:43:46 · 358 阅读 · 0 评论 -
【Codeforces 760 B Frodo and pillows】+ 二分
B. Frodo and pillows time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputn hobbits are planning to spend the night at Frodo’s house. Frod原创 2017-01-25 01:37:15 · 1374 阅读 · 0 评论 -
【HDU 1051 Wooden Sticks】+ 贪心
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20505 Accepted Submission(s): 8297Problem Description There is a pile of n w原创 2017-02-23 21:53:49 · 379 阅读 · 0 评论 -
【Codeforces 765 C. Table Tennis Game 2】+ 贪心
C. Table Tennis Game 2 time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard outputMisha and Vanya have played several table tennis sets. Each s原创 2017-02-15 17:31:48 · 1157 阅读 · 0 评论 -
【Codeforces E Hanoi Factory】+ 贪心 + 栈
E. Hanoi Factory time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Of course you have heard the famous task about Hanoi Towers, but did you k原创 2017-02-26 12:11:46 · 385 阅读 · 0 评论 -
【UESTC 1329 卿学姐与魔法】+ 优先队列
卿学姐与魔法 Time Limit: 1200/800MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status “你的膜法也救不了你”——蛤在去拯救公主的道路上,卿学姐披荆斩棘,刀刃早已锈迹斑斑。一日卿学姐正在为武器的问题发愁,碰到了正在赏树的天行廖。天行廖嘴角微扬,似乎看穿了卿学姐的心思,故意在此等待。原创 2017-03-27 20:07:59 · 483 阅读 · 0 评论 -
【Codeforces 780 D Innokenty and a Football League 】+ 模拟 + 贪心
D. Innokenty and a Football League time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Innokenty is a president of a new football league in By原创 2017-03-12 12:27:13 · 716 阅读 · 0 评论 -
【POJ 2192 Zipper】+ 贪心 + 字符匹配
Zipper Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18323 Accepted: 6523 DescriptionGiven three strings, you are to determine whether the third string can be formed by comb原创 2017-03-26 11:47:37 · 456 阅读 · 0 评论 -
【UESTC 1334 郭大侠与Rabi-Ribi】+ 贪心 + 优先队列
郭大侠与Rabi-Ribi Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status title最近郭大侠迷上了玩Rabi-Ribi这个游戏。Rabi-Ribi呢,是一个打兔子的动作冒险游戏,萌萌哒的兔子在地上跑来跑去,好萌好萌呀~这个游戏是这样玩的,郭大侠作为一原创 2017-03-26 19:52:21 · 653 阅读 · 0 评论 -
【UESTC 1510 渐变字符串】 + 贪心
渐变字符串 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status 如果一个字符串,它每个字母(第一个除外)为前一个字母的后一位,则这样的字符串被称为“渐变字符串”。如:”abcde”, “hijklmnopqr”等等你有n个写有小写字母的卡片,你要将它们组成尽原创 2017-03-26 20:10:51 · 612 阅读 · 0 评论 -
【Codeforces Gym 100187F 】+ 贪心
Doomsday comes in t units of time. In anticipation of such a significant event n people prepared m vaults in which, as they think, it will be possible to survive. But each vault can accommodate only k原创 2017-03-20 21:49:29 · 530 阅读 · 0 评论 -
【codeforces Gym - 100187K】+ 构造 + 贪心
K. Perpetuum Mobile time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The world famous scientist Innokentiy almost finished the creation of原创 2017-04-12 21:18:24 · 514 阅读 · 0 评论 -
【51nod 1288 汽油补给 】 贪心 & 思维
汽油补给 李陶冶 (命题人) 基准时间限制:1 秒 空间限制:131072 KB 分值: 160 有(N+1)个城市,0是起点N是终点,开车从0 -> 1 - > 2…… -> N,车每走1个单位距离消耗1个单位的汽油,油箱的容量是T。给出每个城市到下一个城市的距离D,以及当地的油价P,求走完整个旅途最少的花费。如果无法从起点到达终点输出-1。 例如D = {10, 9, 8}, P = {原创 2017-08-07 17:20:34 · 738 阅读 · 0 评论 -
【Codeforces 735 C Tennis Championship】+ 贪心
C. Tennis Championship time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputFamous Brazil city Rio de Janeiro holds a tennis tournament a原创 2017-02-05 19:54:21 · 309 阅读 · 0 评论 -
【Codeforces 761 D Dasha and Very Difficult Problem】
D. Dasha and Very Difficult Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputDasha logged into the system and began to solve原创 2017-02-04 15:37:27 · 430 阅读 · 0 评论 -
【codeforces 337C Quiz】 + 贪心
C. Quiz time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Manao is taking part in a quiz. The quiz consists of n consecutive questions. A cor原创 2016-10-21 19:25:33 · 491 阅读 · 0 评论 -
【杭电 1061】 Rightmost Digit
Rightmost DigitProblem Description Given a positive integer N, you should output the most right digit of N^N.Input The input contains several test cases. The first line of the input is a single integ原创 2016-07-22 23:09:19 · 458 阅读 · 0 评论 -
【codeforces 贪心】 Vacations
VacationsDescription Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and wh原创 2016-07-22 23:17:58 · 384 阅读 · 0 评论 -
【Codeforces 贪心】Far Relative’s Problem
Far Relative’s ProblemDescription Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of原创 2016-07-22 23:24:58 · 339 阅读 · 0 评论 -
【杭电 4883】TIANKENG’s restaurant
TIANKENG’s restaurantProblem Description TIANKENG manages a restaurant after graduating from ZCMU, and tens of thousands of customers come to have meal because of its delicious dishes. Today n groups原创 2016-07-22 23:34:27 · 330 阅读 · 0 评论 -
【杭电 1789 】Doing Homework again
Doing Homework againProblem Description 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原创 2016-07-22 23:43:26 · 352 阅读 · 0 评论 -
【杭电 2124】Repair the Wall
Repair the WallProblem Description 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 typhoo原创 2016-07-22 23:49:10 · 446 阅读 · 0 评论 -
【杭电 2111】 Saving HDU
Saving HDUProblem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了。显然,作为多年拼搏的商人,XHD不会坐以待毙的。 一天,当他正在苦思冥想解困良策的时候,突然想到了自己的传家宝,那是公司成立的时候,父亲作为贺礼送来的一个锦囊,徐父当时交代,不到万不得已的时候,不要打开它。“现在不正是最需要的时候吗?”,一边想,XHD一边找到了这原创 2016-07-22 23:53:38 · 368 阅读 · 0 评论 -
【杭电 1009】 FatMouse' Trade
FatMouse’ TradeProblem Description FatMouse 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原创 2016-07-22 23:57:33 · 298 阅读 · 0 评论 -
【POJ 3040】Allowance
AllowanceDescriptionAs a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of coins in N (1 <= N <= 20) different denomina原创 2016-07-23 16:47:56 · 391 阅读 · 0 评论 -
【杭电 2037】今年暑假不AC
今年暑假不ACProblem Description “今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%…”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级原创 2016-07-24 17:38:55 · 377 阅读 · 0 评论 -
【杭电 2187】悼念512汶川大地震遇难同胞——老人是真饿了
悼念512汶川大地震遇难同胞——老人是真饿了Problem Description 时间:2008年5月16日(震后第4天) 地点:汶川县牛脑寨 人物:羌族老奶奶【转载整理】牛脑寨是一个全村600多人的羌族寨子,震后几天,这里依然能常常听到隆隆的声音,那是对面山上石头不断滑落的声音。在完成整个突击队的抢修移动基站的任务后,我提着相机开始记录这里的受创情况。 突然,我的视线里出现一个羌族老人,原创 2016-07-24 17:44:46 · 349 阅读 · 0 评论 -
【POJ 1328】Radar Installation
Radar InstallationDescriptionAssume 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 in原创 2016-07-24 23:07:14 · 355 阅读 · 0 评论 -
【 OpenJ_Bailian 4118 】开餐馆
开餐馆描述 北大信息学院的同学小明毕业之后打算创业开餐馆.现在共有n 个地点可供选择。小明打算从中选择合适的位置开设一些餐馆。这 n 个地点排列在同一条直线上。我们用一个整数序列m1, m2, … mn 来表示他们的相对位置。由于地段关系,开餐馆的利润会有所不同。我们用pi 表示在mi 处开餐馆的利润。为了避免自己的餐馆的内部竞争,餐馆之间的距离必须大于k。请你帮助小明选择一个总利润最大的方案。输原创 2016-07-31 22:32:25 · 672 阅读 · 0 评论 -
【LightOJ 1198】- Karate Competition
Karate CompetitionYour karate club challenged another karate club in your town. Each club enters N players into the match, and each player plays one game against a player from the other team. Each gam原创 2016-07-31 22:49:54 · 318 阅读 · 0 评论 -
【HDU 6000 Wash】优先队列 & 贪心
WashTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 64000/64000 K (Java/Others) Total Submission(s): 1076 Accepted Submission(s): 283Problem Description Mr.Panda is about to engage in hi原创 2017-10-07 17:42:13 · 891 阅读 · 0 评论