
ACM
文章平均质量分 73
is_wyQ
机会只会留给有准备的人
展开
-
【HDU 4006】The kth great number(优先队列)
Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number wri原创 2016-07-18 16:05:58 · 380 阅读 · 0 评论 -
【CodeForces 618B 】Guess the Permutation(水题)
DescriptionBob has a permutation of integers from 1 to n. Denote this permutation as p. The i-th element of p will be denoted as pi. For all pairs of distinct integers i, j between 1 and n, he wrote th原创 2016-04-25 11:07:19 · 635 阅读 · 0 评论 -
【CodeForces 618A】Slime Combining(水题)
DescriptionYour friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.You are going to play a game with these slimes. Initially, you put a single slime by原创 2016-04-25 10:55:35 · 589 阅读 · 0 评论 -
【HDU 2544】最短路(Dij)
Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛原创 2016-04-14 16:23:34 · 367 阅读 · 0 评论 -
【HDU 2084】数塔(dp)
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高度,接下来用N行数字原创 2016-04-13 14:51:37 · 405 阅读 · 0 评论 -
【HDU 1176】免费馅饼(dp)
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏原创 2016-04-13 14:22:57 · 357 阅读 · 0 评论 -
【CodeForces 600B 】Queries about less or equal elements(二分查找)
DescriptionYou are given two arrays of integers a and b. For each element of the second array bj you should find the number of elements in array a that are less than or equal to the value bj.InputThe f原创 2016-04-12 17:21:23 · 1638 阅读 · 0 评论 -
【CodeForces 628C 】Bear and String Distance (贪心)
DescriptionLimak is a little polar bear. He likes nice strings — strings of length n, consisting of lowercase English letters only.The distance between two letters is defined as the difference between原创 2016-04-12 17:13:05 · 484 阅读 · 0 评论 -
【CodeForces 628B】 New Skateboard (数学水)
DescriptionMax wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboard. He left a calculator on the floor and went to ask some money from his parents原创 2016-04-12 16:56:42 · 407 阅读 · 0 评论 -
【HDU 4883】TIANKENG’s restaurant(区间更新)
DescriptionTIANKENG 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 of customers come to enjoy thei原创 2016-04-25 11:19:30 · 311 阅读 · 0 评论 -
【CodeForces 618C】Constellation(几何水题)
DescriptionCat Noku has obtained a map of the night sky. On this map, he found a constellation with n stars numbered from 1 to n. For each i, the i-th star is located at coordinates (xi, yi). No two st原创 2016-04-25 11:27:19 · 747 阅读 · 0 评论 -
【POJ 2387】Til the Cows Come Home(Dij最短路)
DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she want原创 2016-07-18 16:00:12 · 394 阅读 · 0 评论 -
【CodeForces 670A】Holidays(水题)
DescriptionOn the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine原创 2016-05-29 15:55:10 · 449 阅读 · 0 评论 -
【HDU 1005】Number Sequence(规律+水题)
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input consis原创 2016-05-24 11:42:20 · 526 阅读 · 0 评论 -
【HDU 1004】Let the Balloon Rise(STL+水题)
Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is o原创 2016-05-24 11:26:31 · 338 阅读 · 0 评论 -
【HDU 1016】Prime Ring Problem(DFS)
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note:原创 2016-05-24 10:52:18 · 280 阅读 · 0 评论 -
【HDU 1010】Tempter of the Bone(DFS)
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He reali原创 2016-05-24 10:37:05 · 281 阅读 · 0 评论 -
【CodeForces 397B 】On Corruption and Numbers(规律)
DescriptionAlexey, a merry Berland entrant, got sick of the gray reality and he zealously wants to go to university. There are a lot of universities nowadays, so Alexey is getting lost in the diversity原创 2016-04-25 18:51:44 · 400 阅读 · 0 评论 -
【CodeForces 397A 】On Segment's Own Points(水题)
DescriptionOur old friend Alexey has finally entered the University of City N — the Berland capital. Alexey expected his father to get him a place to live in but his father said it was high time for Al原创 2016-04-25 18:37:50 · 308 阅读 · 0 评论 -
【CodeForces 628A】Tennis Tournament(水题)
DescriptionA tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.The tournament takes place in the follow原创 2016-04-12 13:47:28 · 450 阅读 · 0 评论 -
【HDU 3127】WHUgirls(二维完全背包)
DescriptionThere are many pretty girls in Wuhan University, and as we know, every girl loves pretty clothes, so do they. One day some of them got a huge rectangular cloth and they want to cut it into s原创 2016-04-12 13:41:35 · 481 阅读 · 0 评论 -
【HDU 2159】FATE(二维完全背包)
Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最原创 2016-04-08 18:31:46 · 368 阅读 · 0 评论 -
【HDU-1295】非常可乐(bfs)
Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,原创 2016-03-08 20:11:20 · 708 阅读 · 0 评论 -
【HDU-1241】Oil Deposits油田(dfs)
Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a gr原创 2016-03-08 20:04:32 · 458 阅读 · 0 评论 -
【UVA-562】Dividing coins(背包)
DescriptionIt’s commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so eager to get it and the fighting was so f原创 2016-03-08 09:39:36 · 455 阅读 · 0 评论 -
【HDU-2546】饭卡(背包)
Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组原创 2016-03-08 09:13:03 · 591 阅读 · 0 评论 -
【HDU-1058】Humble Numbers 丑数
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the first 20 h转载 2016-03-07 20:13:27 · 894 阅读 · 0 评论 -
【HDU-1087】Super Jumping! Jumping! Jumping!
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you n原创 2016-03-07 20:00:14 · 352 阅读 · 0 评论 -
【杭电2091】空心三角形
Problem Description把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便看看效果。 Input每行包含一个字符和一个整数n(0 Output每个样板三角形之间应空上一行,三角形的中间为空。显然行末没有多余的空格。原创 2015-12-20 19:05:21 · 452 阅读 · 0 评论 -
【HDU 1025】Constructing Roads In JGShining's Kingdom(最长上升子序列LIS)
DescriptionJGShining’s kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines. Half of these cities are rich in resource (we call them rich cities) while原创 2016-07-22 21:14:53 · 485 阅读 · 0 评论 -
【HDU-2639】Bone Collector II(背包)
DescriptionThe title of this problem is familiar,isn’t it?yeah,if you had took part in the “Rookie Cup” competition,you must have seem this title.If you haven’t seen it before,it doesn’t matter,I will原创 2016-03-10 19:58:36 · 538 阅读 · 0 评论 -
【HDU-1863】畅通工程(最小生成树prim)
Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N原创 2016-03-12 22:18:39 · 484 阅读 · 0 评论 -
【HDU 4508 】湫湫系列故事――减肥记I (完全背包)
Description 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的卡路里量。 Input原创 2016-03-28 23:24:45 · 583 阅读 · 0 评论 -
【HDU 1284 】钱币兑换问题 (完全背包)
Description在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。 Input每行只有一个正整数N,N小于32768。 Output对应每个输入,输出兑换方法数。 Sample Input2934 12553 Sample Output718831 13137761 题目大意中文题思路完全背包问题,分析不难得出状态转移方程:dp[j]+=dp原创 2016-03-28 23:17:32 · 915 阅读 · 0 评论 -
【HDU 2147】kiki's game(博弈 PN图)
DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is placed in原创 2016-03-22 13:44:00 · 429 阅读 · 0 评论 -
【HDU 1846】Brave Game(巴什博弈)
Description十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。 今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(game)专题;所以,大家现在玩的也是“勇敢者的游戏”,这也是我命名这个题目的原因。 当然,除了“勇敢”,我还希原创 2016-03-22 13:02:54 · 514 阅读 · 0 评论 -
【HDU 1203】I NEED A OFFER!(01背包)
DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的原创 2016-03-17 21:45:10 · 312 阅读 · 0 评论 -
【POJ 1837】Balance(01背包)
DescriptionGigel has a strange “balance” and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm’s length is原创 2016-03-15 17:20:14 · 328 阅读 · 0 评论 -
【POJ 3628】Bookshelf 2(01背包)
DescriptionFarmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top.FJ has N cows (1 ≤ N ≤ 20)原创 2016-03-15 16:55:26 · 438 阅读 · 0 评论 -
【POJ-3624】Charm Bracelet (01背包)
DescriptionBessie has gone to the mall’s jewelry store and spies a charm bracelet. Of course, she’d like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm原创 2016-03-15 16:41:15 · 343 阅读 · 0 评论