动态规划
文章平均质量分 79
Liao_Jingyi
这个作者很懒,什么都没留下…
展开
-
noip1999(提高组) 导弹拦截
题目描述某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。输入格式输入数据为两行,第一行为导弹的数目N(n第二行导弹依次飞来的高度,所有高度值均为原创 2014-06-28 15:34:34 · 2671 阅读 · 0 评论 -
LA 4888 Railroad
DescriptionA train yard is a complex series of railroad tracks for storing, sorting, or loading/unloading railroad cars. In this problem, the railroad tracks are much simpler, and we are only inte原创 2015-01-21 18:49:33 · 626 阅读 · 0 评论 -
POJ 3636 Nested Dolls
Nested DollsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7861 Accepted: 2134DescriptionDilworth is the world's most prominent collector of Russia原创 2015-02-06 02:23:23 · 813 阅读 · 0 评论 -
CF 277 Div2 E LIS of Sequence
E. LIS of Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe next "Data Structures and Algorithms" lesson w原创 2015-01-18 00:15:00 · 429 阅读 · 0 评论 -
tyvj1544找啊找啊找GF
背景"找啊找啊找GF,找到一个好GF,吃顿饭啊拉拉手,你是我的好GF.再见.""诶,别再见啊..."七夕...七夕...七夕这个日子,对于sqybi这种单身的菜鸟来说是多么的痛苦...虽然他听着这首叫做"找啊找啊找GF"的歌,他还是很痛苦.为了避免这种痛苦,sqybi决定要给自己找点事情干.他去找到了七夕模拟赛的负责人zmc MM,让她给自己一个出题的任务.经过几天的死缠烂打,zm原创 2014-12-08 00:34:23 · 793 阅读 · 0 评论 -
HDU 4165 Pills
PillsTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionAunt Lizzie takes half a pill of a certain medicine every day. S原创 2015-01-27 21:20:54 · 477 阅读 · 0 评论 -
vijos1327 回文词
描述回文词是一种对称的字符串——也就是说,一个回文词,从左到右读和从右到左读得到的结果是一样的。任意给定一个字符串,通过插入若干字符,都可以变成一个回文词。你的任务是写一个程序,求出将给定字符串变成回文词所需插入的最少字符数。 比如字符串“Ab3bd”,在插入两个字符后可以变成一个回文词(“dAb3bAd”或“Adb3bdA”)。然而,插入两个以下的字符无法使它变成原创 2014-11-30 20:17:21 · 1555 阅读 · 0 评论 -
CDOJ 885 方老师买表
方老师买表Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %lluSubmitStatusDescription由于方老师出色的专题讲座,他的名气迅速扩散到全国各地,并通过各地的讲座赚到了很多钱,鉴于现在盛行买表,于是方老师带上了一个H×W的盒子去原创 2014-10-30 23:26:40 · 586 阅读 · 0 评论 -
POJ 1952 BUY LOW, BUY LOWER
POJ - 1952BUY LOW, BUY LOWERTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThe advice to "buy low" is half the formu原创 2014-11-01 16:00:13 · 449 阅读 · 0 评论 -
SPOJ MCARDS
Dave’s little son Maverick likes to play card games, but being only fouryears old, he always lose when playing with his older friends. Also,arranging cards in his hand is quite a problem to him.Wh原创 2015-02-08 18:53:03 · 508 阅读 · 0 评论 -
CF 2014 ACM-ICPC Vietnam National Second Round I. Space Tour
I. Space Tourtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlpha Centauri-M (ACM) is a planet with marvelous scene原创 2015-03-16 16:53:06 · 624 阅读 · 0 评论 -
CDOJ 1114 Cent Savings
Cent SavingsTime Limit: 6000/2000MS (Java/Others) Memory Limit: 262144/262144KB (Java/Others)Submit StatusTo host a regional contest like NWERC a lot of preparation is nece原创 2015-05-17 20:00:57 · 853 阅读 · 0 评论 -
Cf Round #301 (Div. 2) D. Bad Luck Island
D. Bad Luck Islandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Bad Luck Island is inhabited by thre原创 2015-05-01 15:20:54 · 378 阅读 · 0 评论 -
TC SRM656 Div2 500 RandomPancakeStack
Problem StatementCharlie has N pancakes. He wants to serve some of them for breakfast. We will number the pancakes 0 through N-1. For each i, pancake i has width i+1 and deliciousnessd[i].Charli原创 2015-04-17 22:09:09 · 774 阅读 · 0 评论 -
cdoj Egg Broken
E - Eggs brokenTime Limit: 5000/2000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)There is a building which is n floors high. Bob has K same eggs now. It is known原创 2015-04-07 22:47:20 · 570 阅读 · 0 评论 -
CDOJ 796 DAGE(Big Brother)
DAGE(Big Brother) Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Our famous “DAGE”, God Kufeng, likes killing monsters. However, killing monster原创 2015-03-24 20:24:56 · 635 阅读 · 0 评论 -
ZOJ 3623 Battle Ships
DescriptionBattle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which hasL longevity. The player has a military factory, which can produce原创 2015-03-07 20:31:49 · 335 阅读 · 0 评论 -
ZOJ 3626 Treasure Hunt I
DescriptionAkiba is a dangerous country since a bloodsucker living there. Sometimes the bloodsucker will appear and kill everyone who isn't at his hometown. One day, a brave person named CC finds原创 2015-03-06 21:37:32 · 391 阅读 · 0 评论 -
ZOJ 3623 Battle Ships
DescriptionBattle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which hasL longevity. The player has a military factory, which can produce原创 2015-03-05 20:56:42 · 322 阅读 · 0 评论 -
tyvj 1050 最长公共子序列
描述一个字符串A的子串被定义成从A中顺次选出若干个字符构成的串。如A=“cdaad",顺次选1,3,5个字符就构成子串"cad",现给定两个字符串,求它们的最长共公子串。输入格式第一行两个字符串用空格分开。 输出格式最长子串的长度。 测试样例1输入abccd aecd输出3备注两个串的长度均小于2000原创 2014-11-02 00:37:39 · 961 阅读 · 0 评论 -
vijos 1059 积木城堡
描述XC的儿子小XC最喜欢玩的游戏用积木垒漂亮的城堡。城堡是用一些立方体的积木垒成的,城堡的每一层是一块积木。小XC是一个比他爸爸XC还聪明的孩子,他发现垒城堡的时候,如果下面的积木比上面的积木大,那么城堡便不容易倒。所以他在垒城堡的时候总是遵循这样的规则。小XC想把自己垒的城堡送给幼儿园里漂亮的女孩子们,这样可以增加他的好感度。为了公平起见,他决定把送给每个女孩子一样高的城堡,这样可原创 2014-11-01 20:35:56 · 1120 阅读 · 0 评论 -
ZOJ 2565 Cracking SSH
DescriptionFamous secure shell (ssh) protocol is often used to provide remote access to Unix systems. In ssh protocol all communcations with the server are encrypted using a strong cipher, so it is原创 2014-08-20 22:24:37 · 450 阅读 · 0 评论 -
POJ 2096 Collecting Bugs
DescriptionIvan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible原创 2014-07-27 10:29:08 · 407 阅读 · 0 评论 -
UVA 11762 Race to 1
Dilu have learned a new thing about integers, which is - any positive integer greater than 1 can be divided by at least one prime number less than or equal to that number. So, he is now playing with t原创 2014-07-25 15:37:16 · 677 阅读 · 0 评论 -
noip2001(普及组) 装箱问题
题目描述有一个箱子容量为V(正整数,0<=V<=20000),同时有n个物品(0<n<=30=,每个物品有一个体积(正整数)。要求n个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。输入格式输入:第一行是一个整数v,表示箱子容量第二行是一个整数n,表示有n个物品接下来n行,分别表示这n 个物品的各自体积输出格式一个整数,表示箱子剩余空间。原创 2014-07-02 16:40:07 · 1632 阅读 · 0 评论 -
rqnoj 456 低价购买
题目描述“低价购买”这条建议是在奶牛股票市场取得成功的一半规则。要想被认为是伟大的投资者,你必须遵循以下的问题建议:“低价购买;再低价购买”。每次你购买一支股票,你必须用低于你上次购买它的价格购买它。买的次数越多越好!你的目标是在遵循以上建议的前提下,求你最多能购买股票的次数。你将被给出一段时间内一支股票每天的出售价(2^16范围内的正整数),你可以选择在哪些天购买这支股票。每次购买都必须遵循原创 2014-07-02 15:16:12 · 1057 阅读 · 0 评论 -
UVA 12385 Interesting Sequences
I - Interesting Sequences For a sequence of integer numbers 1,x2, ,xn>, a contiguous subsequence i,xi+1, ,xj> where ii=xj). Two interesting subsequences S1=i,xi+1, ,xj> and S2=a,xa+1, ,xb> are cal原创 2014-07-21 17:57:14 · 714 阅读 · 0 评论 -
SPOJ AMR11A
Description Thanks a lot for helping Harry Potter in finding the Sorcerer's Stone of Immortality in October. Did we not tell you that it was just an online game ? uhhh! now here is the real on原创 2014-07-20 12:09:35 · 697 阅读 · 0 评论 -
noip2004(提高组) 合唱队形
题目描述 N位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形。 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2…,K,他们的身高分别为T1,T2,…,TK, 则他们的身高满足T1Ti+1>…>TK(1 你的任务是,已知所有N位同学的身高,计算最少需要几位同学出列,可以使得剩下的同学排成合唱队形。输入格式输入的第一行原创 2014-06-28 16:31:07 · 1265 阅读 · 0 评论 -
CF 267C George and Job
C. George and Jobtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe new ITone 6 has been released recently and Georg原创 2014-09-20 00:32:44 · 596 阅读 · 0 评论 -
UVA 10917 Walk Through the Forest
Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even nicer, his office is o原创 2014-08-17 17:01:20 · 480 阅读 · 0 评论 -
HDU 1992 Tiling a Grid With Dominoes
Tiling a Grid With DominoesTime Limit:500MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionWe wish to tile a grid 4 units high and N uni原创 2014-10-30 23:45:39 · 726 阅读 · 0 评论 -
CF 272B Dreamoon and WiFi
B. Dreamoon and WiFitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDreamoon is standing at the position 0 on a numbe原创 2014-10-12 22:55:08 · 491 阅读 · 0 评论 -
ZOJ 3805 Machine
H - MachineTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionIn a typical assembly line, machines are connected one by one. The first machi原创 2014-10-12 17:23:15 · 339 阅读 · 0 评论 -
HDU 4022 Bombing
DescriptionIt’s a cruel war which killed millions of people and ruined series of cities. In order to stop it, let’s bomb the opponent’s base.It seems not to be a hard work in circumstances of原创 2014-10-01 10:55:05 · 360 阅读 · 0 评论 -
CF 21C Stripe 2
DescriptionOnce Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative. He became interested in how many ways exi原创 2014-10-01 19:43:41 · 607 阅读 · 0 评论 -
CF 2013-2014 Samara SAU ACM ICPC Quarterfinal Qualification Contest C.Victor's Research
C. Victor's Researchtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputUnacknowledged scientist Victor conducts a pseud原创 2014-10-26 15:20:01 · 1136 阅读 · 0 评论 -
CF 271D Flowers
D. Flowerstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe saw the little game Marmot made for Mole's lunch. Now原创 2014-10-07 11:32:23 · 408 阅读 · 0 评论 -
HDU Walk
DescriptionI used to think I could be anything, but now I know that I couldn't do anything. So I started traveling.The nation looks like a connected bidirectional graph, and I am randomly wa原创 2014-09-14 10:13:28 · 423 阅读 · 0 评论