摘要: http://hi.baidu.com/raulliubo/blog/item/21a2ae8f998408eef11f3629.html 学了一段时间OI,感觉DP学不透。。。。转个贴来激励自己 给定两个序列 X = { x1 , x2 , ... , xm } Y = { y1 , y2 , ... , yn } 求X和Y的一个最长公共子序列 举例 X = { a , b , c , b ... 阅读全文
posted @ 2009-01-04 13:04 jesonpeng 阅读(524) 评论(0) 推荐(0) 编辑
摘要: section1.1 the next problem is Greedy Gift Givers A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to... 阅读全文
posted @ 2009-01-04 13:03 jesonpeng 阅读(272) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/356d8aef929862efce1b3eb8.html Friday the Thirteenth Is Friday the 13th really an unusual event? That is, does the 13th of the month land on a Friday less of... 阅读全文
posted @ 2009-01-04 13:02 jesonpeng 阅读(193) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/aea59710d589fc01213f2eba.html Broken Necklace You have a necklace of N red, white, or blue beads (3s[j]) and (s[j]' ') then break; inc(s1); end; s2:=0;... 阅读全文
posted @ 2009-01-04 13:01 jesonpeng 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Milking Cows Three farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 10... 阅读全文
posted @ 2009-01-04 13:00 jesonpeng 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 棋盘格数(chess.pas) §设有一个N*M方格的棋盘(1<=N,M<=100)。求出该棋盘中包含有多少个正方形、多少个长方形(不包括正方形)。例如:当N=2,M=3时: §正方形的个数有8个:即边长为1的正方形有6个;边长为2的正方形有2个。 §长方形的个数有10个:即2*1的长方形有4个;1*2的长方形有3个;3*1的长方形有2个;3*2的长方形有1个。 §【输入文件】chess.... 阅读全文
posted @ 2009-01-04 12:42 jesonpeng 阅读(197) 评论(0) 推荐(0) 编辑
摘要: THE DRUNK JAILER Time Limit:1000MS Memory Limit:10000K Total Submit:5173 Accepted:3416 Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a... 阅读全文
posted @ 2009-01-04 12:41 jesonpeng 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/61a2868284bfbdbd6d811902.html 1005. Stone pile Time Limit: 2.0 second Memory Limit: 16 MB You have a number of stones with known weights W1…Wn. Write a progr... 阅读全文
posted @ 2009-01-04 12:39 jesonpeng 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/45a1bb447116f680b2b7dcc6.html yo2那边上不去。。。就来这先写吧。此题为标准的bfs。但是dfs,枚举也能过。我简单的go了一下就过了。。。。就是这个效率。。。。不知我这个搜索叫什么,深度没有下限,搜... 阅读全文
posted @ 2009-01-04 12:37 jesonpeng 阅读(229) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/a2b321c7715109ded1006088.html 这两个题是如此的相似,除了数据范围。 意思就是把一个序列从中间分成两半,使这两半中的两个片段的和的和最大。 做法是这样的,前从前面扫一遍,dp求从第i个位置分,前i的最大和。然后再从后面扫一遍,求出从第i的位置分,[i+1,n]的最大和,同时更新最大值。 ... 阅读全文
posted @ 2009-01-04 12:35 jesonpeng 阅读(276) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/fd52a338aecc22c6d4622579.html 1028. Stars Time Limit: 0.25 second Memory Limit: 16 MB Astronomers often examine star maps where stars are represented by poin... 阅读全文
posted @ 2009-01-04 12:30 jesonpeng 阅读(241) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/db8b8a52731d030a0cf3e3a5.html 发现sbt退化版奇好无比。又快又短。OYE. 1949443 12:18:20 5 Feb 2008 raulliubo ... 阅读全文
posted @ 2009-01-04 12:28 jesonpeng 阅读(179) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/b91fec249f207e378744f9a6.html !!神奇了。。刚才又交了一遍kruskal的程序,竟然tmd AC了。。难道这就是传说中的RPWT。。我的RP低到极点了。 USER: BO LIU [raulliu2] TASK: agrinet LANG: PASCAL Compiling... ... 阅读全文
posted @ 2009-01-04 12:27 jesonpeng 阅读(194) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/e2323f1ff6dca2cca78669f3.html 完全背包 普通背包的写法是 for i := 1 to n do for j := m downto 1 do 这是为了防重复,而允许重复的写法就是 for i := 1 to n do for j := 1 to m do OK了。... 阅读全文
posted @ 2009-01-04 12:26 jesonpeng 阅读(133) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/2f635b34f75a434a251f14b5.html 一开始老是WA。吓了我一身汗,还以为SBT啥地方写错了。。。结果最后一看。。qsort写错了。我真无语了。 my ugly code: var a, key, size, lch, rch : array[0 .. 100001] of ... 阅读全文
posted @ 2009-01-04 12:25 jesonpeng 阅读(208) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/d07461f4c78417ddf2d385b3.html ID Date Author Problem Language Judgement result ... 阅读全文
posted @ 2009-01-04 12:24 jesonpeng 阅读(163) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/db8b8a527fb6070a0df3e372.html 今天一下午光做这道题了。。这题很明显的离散化 + 线段树。RE了半天,郁闷了我半天,为什么呢,为什么呢。一直不知道为什么。 最后抱着试一试的想法把数组开的大了些。。结果。。。TMD AC了。。我再次无语了。 my ugly code: type lis... 阅读全文
posted @ 2009-01-04 12:24 jesonpeng 阅读(208) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/801aca168f3fdd1c972b43f8.html 这个题琢磨了一阵子。。。发现由于最后一个人的位置肯定是固定的,所以我们可以从后往前推,即从最后一个插队的人开始推。设一个长度为n的值全为1的序列。一个人的插入位置若为pos,则它在序列中的最终位置就是pos+1(因为他是站在pos后面)。 想明白这个应该就很好... 阅读全文
posted @ 2009-01-04 12:23 jesonpeng 阅读(295) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/24587160e34cff40eaf8f865.html 在众多大牛的指点下AC了。以前总WA竟然是因为数组开小了。。。这不应该是RE吗。。怎么WA了。抑郁了,还以为算法错了。这题考的就是线段树加二进制储存信息。。。。 my ugly code: var color, left, right : array[... 阅读全文
posted @ 2009-01-04 12:22 jesonpeng 阅读(265) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/raulliubo/blog/item/416faa7ec7321d3c0dd7da57.html USER: BO LIU [raulliu2] TASK: rect1 LANG: PASCAL ... 阅读全文
posted @ 2009-01-04 12:21 jesonpeng 阅读(240) 评论(0) 推荐(0) 编辑