欢迎访问我的个人网站==》 jiashubing.cn
摘要: 最长公共子序列 • 若给定序列X={x1,x2,…,xm},则另一序列Z={z1,z2,…,zk},是X的子序列是指存在一个严格递增下标序列{i1,i2,…,ik}使得对于所有j=1,2,…,k有:zj=xij。 例如,序列Z={B,C,D,B}是序列X={A,B,C,B,D,A,B}的子序列,相应 阅读全文
posted @ 2013-06-22 13:15 贾树丙 阅读(911) 评论(0) 推荐(0) 编辑
摘要: 动态规划&矩阵连乘 动态规划的概念 • 与分治方法类似 分-治-合 • 与分治方法不同 子问题之间并非相互独立 • 基本思想 用一个表记录所有子问题的解,不管子问题是否被用到,只要它被计算过,就将其结果备份至表中 动态规划的基本要素 • 最优子结构 利用问题的最优子结构性质,以自底向上的方式递归地从 阅读全文
posted @ 2013-06-22 12:30 贾树丙 阅读(652) 评论(0) 推荐(0) 编辑
摘要: JugsTime Limit:2 Seconds Memory Limit:65536 KB Special JudgeIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon jug with exactly 4 gallons. This proble 阅读全文
posted @ 2013-06-15 19:20 贾树丙 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 林教主的面试 林教一表人才, 才高八斗, 英明神武, 英俊潇洒, 玉树临风, 风流倜傥, 盖世无双, 人见人爱, 花见花开, 十全十美, 完美无缺, 空前绝后, 名垂青史. 万古流芳. 林教凭借他一日万行的编码速度,和5分钟内秒杀一切能做题目的惊人思维,还有对计算几何优化网络流等神级算法的深刻理解,获得所有集训队的一致认可, 在亚洲区域赛上更是摘金夺银, 独占鳌头.已经进入大四的林教, 由于难遇敌手, 以致于心灰意冷, 无心恋战, 毅然选择了直接进入人生的下一阶段----工作.林教首先来到了某国内知名公司(简称A公司). 由于A公司的所有员工都害怕林教进入A公司之后, 会掩盖了他们所有人的光芒 阅读全文
posted @ 2013-06-11 10:42 贾树丙 阅读(361) 评论(0) 推荐(0) 编辑
摘要: The GameTime Limit:2 Seconds Memory Limit:65536 KBOne morning, you wake up and think: ``I am such a good programmer. Why not make some money?'' So you decide to write a computer game.The game takes place on a rectangular board consisting of w * h squares. Each square might or might not conta 阅读全文
posted @ 2013-06-10 21:06 贾树丙 阅读(375) 评论(0) 推荐(0) 编辑
摘要: AtlantisTime Limit:2 Seconds Memory Limit:65536 KBThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different regions of Atlantis. Your friend Bill has to 阅读全文
posted @ 2013-06-09 11:19 贾树丙 阅读(295) 评论(0) 推荐(0) 编辑
摘要: Dreisam EquationsTime Limit:10 Seconds Memory Limit:32768 KB Special JudgeDuring excavations in the Dreisamwuste, a desert on some far away and probably uncivilized planet, sheets of paper containing mysterious symbols had been found. After a long investigation, the project scientists have concluded 阅读全文
posted @ 2013-06-09 10:26 贾树丙 阅读(704) 评论(0) 推荐(0) 编辑
摘要: 2013年省赛总结 只是觉得单单省赛,也写不出些什么,还是用现在能想到的所有事情来填充篇幅吧! 昨天,白天睡了太久,以至于夜晚了无睡意,躺在床上睁大了眼睛,让我怀疑从前是如何入睡的。之后看了一部影片,名唤《风雨哈佛路》。影片最后,女主角莉斯安静地坐在大教室,悠闲自得的听教授讲课,那一瞬间居然很感动。 阅读全文
posted @ 2013-05-20 00:59 贾树丙 阅读(285) 评论(2) 推荐(0) 编辑
摘要: 1.乱码加 ’\0’; 2.char str[100]; gets(str);字符从0开始存 gets(&str[1]);从1开始存 3.三角形知三边求面积 P=(L1+L2+L3)/2; S=sqrt(P*(P –L1)*(P-L2)*(P-L3)); 按此法可求凸多边形 4.0xffffff 最 阅读全文
posted @ 2013-05-10 15:02 贾树丙 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Boring RankingTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%lld & %lluDescriptionNew term is coming, so the annual scholarship is going to be distributed. But Alibaba can’t wait to know how much he can get. Now he gets all the info including every course’s score and quality score of ever 阅读全文
posted @ 2013-05-09 21:01 贾树丙 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Next K-Bit NumberTime Limit:1 SecMemory Limit:128 MBSubmissions:368Solved:138Description Our problem is to create a function:uintNextKBitNumber(uint), which given an unsigned integer X with K bits set, returns the immediately larger unsigned integer also with K bits set. For example, if X = 12 (bas. 阅读全文
posted @ 2013-05-08 09:54 贾树丙 阅读(389) 评论(0) 推荐(0) 编辑
摘要: Lazy. Lazy. Laaaaaaaaaaaazy!Time Limit:1 SecMemory Limit:128 MBSubmissions:233Solved:78Description YangShenis very lazy. One day, he received a typing task from his leader Mr. He, which is non-technical, time-wasteful and as boring as possible. As this,YangShen, the laziest one in the world, want... 阅读全文
posted @ 2013-05-08 08:43 贾树丙 阅读(486) 评论(0) 推荐(0) 编辑
摘要: DollarsNew Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may be made up. Changing the order of listing does not increase the count. Thus 20c may be made up 阅读全文
posted @ 2013-04-30 15:26 贾树丙 阅读(328) 评论(0) 推荐(0) 编辑
摘要: Let Me Count The WaysAfter making a purchase at a large department store, Mel's change was 17 cents. He received 1 dime, 1 nickel, and 2 pennies. Later that day, he was shopping at a convenience store. Again his change was 17 cents. This time he received 2 nickels and 7 pennies. He began to wond 阅读全文
posted @ 2013-04-30 14:46 贾树丙 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Coin ChangeSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 11 cents, then we can make changes with one 10-cent coin and one 1-cent coin, two 5-cent coins and one 1-cent coi 阅读全文
posted @ 2013-04-30 11:40 贾树丙 阅读(888) 评论(0) 推荐(0) 编辑