随笔分类 -  模拟

摘要:同学的同学问了这样一个问题:有一对小老鼠,出生一周后长成一对大老鼠,两周后这对老鼠生出第一对小老鼠,三周后上周出生的小老鼠变成大老鼠,而原来的大老鼠又生出了一对小老鼠之后便死了,四周后,第一对出生的小老鼠(此时已经是大老鼠)又生出了一对小老鼠,此时共有三对老鼠。编程,计算N周后有多少对老鼠?首先,这个问题如果小鼠没有死亡,就是一个典型的斐波那契数列(事实上斐波那契数列最早就是描述兔子繁殖的)加上死亡,就需要重新考虑一下了~方法一: 自然是超级水的同时很管用的----找规律法。周数 0-----1-----2-----3-----4-----5-----6-----7.............. 阅读全文
posted @ 2012-06-11 20:19 漂木 阅读(1053) 评论(0) 推荐(0)
摘要:2154: Hungry RabbitsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1231423StandardA group of hungry rabbits had got a basket of carrots, but these carrots isn't enough for all the rabbits to stay alive. So they had a meeting to solve the problem. They determined to drive off some rabbi 阅读全文
posted @ 2012-05-03 22:33 漂木 阅读(338) 评论(0) 推荐(0)
摘要:1474: Soundex IndexingResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K246119StandardThe Soundex Index System was developed so that similar sounding names, or names with similar spelling could be encoded for easy retrieval. It has been used by the U.S. Bureau of the Census, and some States u 阅读全文
posted @ 2012-04-17 17:11 漂木 阅读(425) 评论(0) 推荐(0)
摘要:1025: LC-DisplayResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K2251642StandardA friend of you has just bought a new computer. Until now, the most powerful computer he ever used has been a pocket calculator. Now, looking at his new computer, he is a bit disappointed, because he liked the LC 阅读全文
posted @ 2012-03-24 21:57 漂木 阅读(224) 评论(0) 推荐(0)
摘要:1019: Do the UntwistResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1151641StandardCryptographydeals with methods of secret communication that transform a message (theplaintext) into a disguised form (theciphertext) so that no one seeing the ciphertext will be able to figure out the plainte 阅读全文
posted @ 2012-03-24 20:27 漂木 阅读(261) 评论(0) 推荐(0)
摘要:2528: SaveResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s65536K461162Standard津津的零花钱一直都是自己管理。每个月的月初妈妈给津津300元钱,津津会预算这个月的花销,并且总能做到实际花销和预算的相同。 为了让津津学习如何储蓄,妈妈提出,津津可以随时把整百的钱存在她那里,到了年末她会加上20%还给津津。因此津津制定了一个储蓄计划:每个月的月初,在得到妈妈给的零花钱后,如果她预计到这个月的月末手中还会有多于100元或恰好100元,她就会把整百的钱存在妈妈那里,剩余的钱留在自己手中。 例如11月初津津手中还有83元 阅读全文
posted @ 2012-03-24 14:13 漂木 阅读(235) 评论(0) 推荐(0)