随笔分类 -  dp经典

摘要:Problem DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking lineup to pl 阅读全文
posted @ 2013-12-20 13:43 persistent codeants 阅读(230) 评论(0) 推荐(0)
摘要:Problem DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind which city being his start station because superman can bring him to any city at first but only o 阅读全文
posted @ 2013-12-01 17:19 persistent codeants 阅读(205) 评论(0) 推荐(0)
摘要:DescriptionThere arenpeople standing in a row. And There aremnumbers, 1.2...m. Every one should choose a number. But if two persons standing adjacent to each other choose the same number, the number shouldn't equal or less thank. Apart from this rule, there are no more limiting conditions.And yo 阅读全文
posted @ 2013-11-27 20:07 persistent codeants 阅读(171) 评论(0) 推荐(0)
摘要:DescriptionWhen 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 it is true to entertain ourselves) if you know the other prophecies appeared in theMaya Calenda 阅读全文
posted @ 2013-11-27 16:03 persistent codeants 阅读(197) 评论(0) 推荐(0)
摘要:DescriptionThe 2012 Europe Cup was over and Spain won the Championship. The fans of Spain want to hold some activities to celebrate. But there is a question. Some of them are the fans of F.C Barcelona and the others are Real Madrid. It is well-known that the relation of these two clubs is very bad. 阅读全文
posted @ 2013-11-27 13:19 persistent codeants 阅读(183) 评论(0) 推荐(0)
摘要:DescriptionBattle Shipsis a new game which is similar toStar Craft. In this game, the enemy builds a defense tower, which hasLlongevity. The player has a military factory, which can produceNkinds of battle ships. The factory takestiseconds to produce thei-th battle ship and this battle ship can make 阅读全文
posted @ 2013-11-21 13:54 persistent codeants 阅读(212) 评论(0) 推荐(0)
摘要:Problem DescriptionYou're given an unlimited number of pebbles to distribute across an N x N game board (N drawn from [3, 15]), where each square on the board contains some positive point value between 10 and 99, inclusive. A 6 x 6 board might look like this:The player distributes pebbles across 阅读全文
posted @ 2013-11-10 09:15 persistent codeants 阅读(210) 评论(0) 推荐(0)
摘要:Problem DescriptionIgnatius 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 in the homework after the deadline, the teacher will reduce his score of the final test, 1 day for 1 poin 阅读全文
posted @ 2013-11-09 20:59 persistent codeants 阅读(223) 评论(0) 推荐(0)
摘要:Problem DescriptionOrganizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satisfy the following two terms:1. All of the teams solve at least one problem.2. The champion (One of those teams that solve the most p 阅读全文
posted @ 2013-10-26 20:05 persistent codeants 阅读(234) 评论(0) 推荐(0)
摘要:DescriptionEverybody is fond of computers, but buying a new one is always a money challenge. Fortunately, there is always a convenient way to deal with. You can replace your computer and get a brand new one, thus saving some maintenance cost. Of course, you must pay a fixed cost for each new compute 阅读全文
posted @ 2013-10-12 10:48 persistent codeants 阅读(294) 评论(0) 推荐(0)
摘要:DescriptionDearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of them can be seen as of only one color. In order to prevent the clothes from getting dyed in 阅读全文
posted @ 2013-10-12 09:21 persistent codeants 阅读(192) 评论(0) 推荐(0)
摘要:When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there areNpeople living in a straight street that is just lies on an X-coordinate axis. Theithperson's coordinate isXimeters 阅读全文
posted @ 2013-10-09 13:08 persistent codeants 阅读(349) 评论(0) 推荐(0)
摘要:DescriptionHumans have discovered a kind of new metal mineral on Mars which are distributed in point�like with paths connecting each of them which formed a tree. Now Humans launches k robots on Mars to collect them, and due to the unknown reasons, the landing site S of all robots is identified in ad 阅读全文
posted @ 2013-10-07 12:46 persistent codeants 阅读(172) 评论(0) 推荐(0)
摘要:DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a sneaker store.There are several brands of sneakers that Iserlohn wants to collect, such as Air Jordan and Nike Pro. And each bra 阅读全文
posted @ 2013-10-06 19:19 persistent codeants 阅读(194) 评论(0) 推荐(0)
摘要:DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a sneaker store.There are several brands of sneakers that Iserlohn wants to collect, such as Air Jordan and Nike Pro. And each bra 阅读全文
posted @ 2013-10-06 19:17 persistent codeants 阅读(192) 评论(0) 推荐(0)
摘要:DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int dp[500010],i,j,k; 8 int n; 9 struct ds10 {11 int a,h,c;12 }e[500001];13 bool ... 阅读全文
posted @ 2013-10-06 13:24 persistent codeants 阅读(275) 评论(0) 推荐(0)
摘要:Problem DescriptionKeeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows pass by a scanner. Each ID tag's contents are currently a single string with length 阅读全文
posted @ 2013-09-19 10:48 persistent codeants 阅读(238) 评论(0) 推荐(0)
摘要:1182. Team Them Up!Time limit: 1.0 second Memory limit: 64 MBYour task is to divide a number of persons into two teams, in such a way, that:everyone belongs to one of the teams;every team has at least one member;every person in the team knows every other person in his team;teams are as close in thei 阅读全文
posted @ 2013-09-07 08:55 persistent codeants 阅读(385) 评论(0) 推荐(0)
摘要:Problem DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl has its name because it delivers to the royal family of Pearlania. But it also produces bracelets and necklaces for ordinary people. Of cours 阅读全文
posted @ 2013-09-01 21:15 persistent codeants 阅读(255) 评论(0) 推荐(0)
摘要:Problem DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k=1,N, and for each denomination Dk the machine has a supply of nk bills. For exam 阅读全文
posted @ 2013-09-01 20:25 persistent codeants 阅读(280) 评论(0) 推荐(0)