摘要: ZOJ Problem Set - 2965Accurately Say "CocaCola"!Time Limit:1 Second Memory Limit:32768 KBIn a party held by CocaCola company, several students stand in a circle and play a game.One of them is selected as the first, and should say the number 1. Then they continue to count number from 1 one 阅读全文
posted @ 2011-07-02 22:45 Gavin Lipeng Ma 阅读(400) 评论(0) 推荐(0) 编辑
摘要: ZOJ Problem Set - 2947AbbreviationTime Limit:1 Second Memory Limit:32768 KBWhen a Little White meets another Little White:Little White A: (Surprised) !Little White B: ?Little White A: You Little White know "SHDC"? So unbelievable!Little White B: You are little white! Little white is you! W 阅读全文
posted @ 2011-07-02 16:43 Gavin Lipeng Ma 阅读(467) 评论(0) 推荐(0) 编辑
摘要: ZOJ Problem Set - 2932The Seven Percent SolutionTime Limit:1 Second Memory Limit:32768 KBUniform Resource Identifiers (or URIs) are strings likehttp://icpc.baylor.edu/icpc/,mailto:foo@bar.org,ftp://127.0.0.1/pub/linux, or even justreadme.txtthat are used to identify a resource, usually on the Intern 阅读全文
posted @ 2011-07-02 16:25 Gavin Lipeng Ma 阅读(303) 评论(0) 推荐(0) 编辑
摘要: ZOJ Problem Set - 2970Faster, Higher, StrongerTime Limit:1 Second Memory Limit:32768 KBIn the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China and Beijing Olympics is to be a festival for people all over the world as well.The motto of Olympic Games 阅读全文
posted @ 2011-07-02 15:56 Gavin Lipeng Ma 阅读(397) 评论(0) 推荐(0) 编辑
摘要: Daffodil numberTime Limit:1 Second Memory Limit:32768 KBThe daffodil number is one of the famous interesting numbers in the mathematical world. A daffodil number is a three-digit number whose value is equal to the sum of cubes of each digit.For example. 153 is a daffodil as 153 = 13+ 53+ 33.InputThe 阅读全文
posted @ 2011-07-02 15:44 Gavin Lipeng Ma 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 手头正在做一个项目,在项目中很多地方为了开发的快捷,往往我们总工程师就会要求我们尽量为一组功能相仿的模块写通用的代码,这样可以最大程度的减少工作量。虽然开始写的通用成都高的,可复用程度高的代码会很痛苦,几个算法的设计会让人抓狂!但是一旦完成了,对于我个人来说,那是很兴奋的,这种兴奋,就像当初在学校的时候完成一道理科题目一样,难以抑制。对于项目组来说,那也是一劳永逸的事情。最近碰到的是为一组向web service发送数据的需求。发送的数据符合xml规范。这样一来,对于服务器端来说,定义这样的数据的时候,自然会根据需求所定义的schema来生成服务器端得数据类型。其实说白了,就是一组xml到ja 阅读全文
posted @ 2011-03-19 21:58 Gavin Lipeng Ma 阅读(6519) 评论(0) 推荐(1) 编辑
摘要: Time Limit: 2 Seconds Memory Limit: 65536 KBFor 2 non-negative integers x and y, f(x, y) is defined as the number of different bits in the binary format of x and y. For example, f(2, 3)=1, f(0, 3)=2, f(5, 10)=4.Now given 2 sets of non-negative integers A and B, for each integer b in B, you should fi 阅读全文
posted @ 2011-03-17 20:13 Gavin Lipeng Ma 阅读(501) 评论(0) 推荐(1) 编辑
摘要: The Circumference of the Circle Time Limit: 1 Second Memory Limit: 32768 KB To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't?... 阅读全文
posted @ 2011-03-10 12:24 Gavin Lipeng Ma 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 很久没有再做算法题了,做作算法题,就当是休闲娱乐了。下面是一道简单的题目,难题我也没有能力解,只能拿简单题开刀了。 Rounders Time Limit: 1 Second Memory Limit: 32768 KB Introduction For a given number, if greater than ten, round it to the nearest ten, then (... 阅读全文
posted @ 2011-03-09 12:43 Gavin Lipeng Ma 阅读(1042) 评论(5) 推荐(0) 编辑
摘要: 很久很久以前,我问我的朋友:“现在有什么好书可以研究研究的啊?”“设计模式啊。”他不假思索的回答我。想想也是,设计模式确实是一本经典的书,于是乎我又开始了《设计模式》这本书的阅读过程。本人对于设计模... 阅读全文
posted @ 2011-03-08 13:40 Gavin Lipeng Ma 阅读(1847) 评论(3) 推荐(0) 编辑
摘要: 很久没有做算法题了,其实做一些算法题对自己也是有很大的帮助的,至少再闲暇无聊的时候,可以消磨时间也是一件很不错的休闲娱乐活动。下面是一道简单题,热身用的,呵呵,以后有空我要多做做这类算法题了,一方面娱乐,一方面也是扩展自己思维的一个很不错的选择。 原题如下: ZOJ Problem Set - 1113 u Calculate e Time Limit: 1 Second ... 阅读全文
posted @ 2010-10-06 01:20 Gavin Lipeng Ma 阅读(2185) 评论(0) 推荐(0) 编辑
摘要: 哈哈哈,好久没有到博客园逛了,还真有点怀念。记得以前曾经有过一种想法,坚持每天都发一篇随笔,但是现在看来,是不可能了。自己坚持不住。有这份毅力的人,估计也不会是什么一般人,而我,只是一个一般人,哈哈哈哈~~ 阅读全文
posted @ 2010-07-20 20:08 Gavin Lipeng Ma 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 就像QQ那样的,相同的一个QQ账号是不可以同时在不同的地方登陆的。QQ采用的方式是,采用相同账号后登陆的用户将会把先登录的用户“挤掉”。但是我觉得,这样做并不是做好的做法。考虑一种情况,后一个登录的用户是非法的,这样一来,这个非法的用户就把前一个合法的用户“挤掉”了,如果能够实现相同账号始终只能登录一次,在登录状态下,后登陆的用户发出的登录请求被拒绝,那么,只要合法用户始终在线,非法用户就无法对前... 阅读全文
posted @ 2010-05-11 16:00 Gavin Lipeng Ma 阅读(2354) 评论(1) 推荐(0) 编辑
摘要: 长时间不做算法题了,这么简单的题目都然给我纠结了那么久,尴尬……先把题目贴出来,稍作分析,相信小孩子都可以看得懂了。原题:Goldbach's ConjectureTime Limit: 1 Second Memory Limit: 32768 KBGoldbach's Conjecture: For any even number n greater than or ... 阅读全文
posted @ 2010-04-27 21:41 Gavin Lipeng Ma 阅读(1438) 评论(0) 推荐(0) 编辑
摘要: 很久没有在学习C++了,以前掌握的东西,现在也忘记的差不多了,偶尔想起了一些,顺便就记下来吧,省的我下次再想到的时候,又要纠结老半天才能想起来。 C++指针,我觉得应该可以分为两类:数据指针和函数指针。其中,数据指针也包括两类:普通数据指针和成员数据指针;函数指针也包括普通函数指针和成员函数指针。在学习C++的过程中,首先接触到的指针问题,大多是普通的数据指针,这一类指针是应用的很多的指针也是相... 阅读全文
posted @ 2010-04-22 11:19 Gavin Lipeng Ma 阅读(2297) 评论(5) 推荐(1) 编辑
摘要:      用Java EE的人都知道了,当需要连接到数据库的时候必定需要用到JDBC。终于,今天我也遇到了这个问题。对于像我这样的初学者来说,要搞定这个JDBC还是有一定困难的。至少我自己就用了整整一个下午加一个晚上才搞定这个东西,比较囧。不说废话了,直接把方法写下来,即方便自己以后查看,另一方面也方便像我这样的初学者查阅。   ... 阅读全文
posted @ 2010-03-23 22:40 Gavin Lipeng Ma 阅读(1802) 评论(9) 推荐(1) 编辑
摘要: 以前一个很平常的问题,就是怎么去计算大数的问题。当然这里的大数不是说几万或者几十万这样的数字,而是那些……反正就是很大很大的数字,大到我都念不出来。要处理大数,很早以前,我是用一个字符串来模拟数值计算的,感觉算法上没有问题,但是效率上就低的有点让人不能接受了。后来才有同学告诉我,其实可以用数组的,用数字数组,这样一来,操作上跟我用字符串没有什么区别,但是计算的效率上就会... 阅读全文
posted @ 2010-03-19 13:10 Gavin Lipeng Ma 阅读(431) 评论(4) 推荐(0) 编辑
摘要: 都说“上有天堂,下有苏杭”,这苏州市什么情况我就不知道了,没有在那边生活过。但是杭州,我敢保证,绝对不是什么天堂!一年有四季,每一季都有不同的特点,这可说是四季分明了。话说这四季分明却也不是什么坏事,而且还有很多人都很喜欢呢。但是杭州的四季,都有不同的让人真的是“难忘”的记忆。先说说这春天。“冬天过去了,春天还会远吗?”没错,... 阅读全文
posted @ 2010-03-05 20:04 Gavin Lipeng Ma 阅读(270) 评论(6) 推荐(0) 编辑
摘要: 原题: Parencodings Time Limit: 1 Second      Memory Limit: 32768 KB Let S = s1 s2 ... s2n be a well-formed string of parentheses. S can be encoded in two different ways: By an ... 阅读全文
posted @ 2010-02-25 11:25 Gavin Lipeng Ma 阅读(870) 评论(3) 推荐(0) 编辑
摘要:        这是我最后一个假期了,确切的说,是最后一个寒假,马上就要结束校园生活走向社会,突然有一种失落。也许是一种胆怯,长时间的躲在校园这样一个被保护的对象,突然之间要自己去面对这个残酷的社会,有的是一种无奈,也是不知所措。不过在这种时候,我想,我最需要,是勇气和对未来的憧憬。未来从来就不是梦,我是那种心理特别阳光的人,对未来的美好憧... 阅读全文
posted @ 2010-02-24 13:43 Gavin Lipeng Ma 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 原题如下: The Worm Turns Time Limit: 1 Second      Memory Limit: 32768 KB Worm is an old computer game. There are many versions, but all involve maneuvering a "worm" a... 阅读全文
posted @ 2010-02-23 15:21 Gavin Lipeng Ma 阅读(1609) 评论(0) 推荐(2) 编辑
摘要: Financial Management Time Limit: 1 Second      Memory Limit: 32768 KB Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to h... 阅读全文
posted @ 2010-02-22 21:27 Gavin Lipeng Ma 阅读(317) 评论(0) 推荐(0) 编辑
摘要:      真的是不行了,很长时间没有玩过这玩意儿了,一下子上来,还真是很不习惯。碰了很多壁,终于碰到了这么一道相对比较简单的题目,也算是捡回一点点自信吧,希望以后会越走越好。       下面先给出原题: ZOJ Problem Set - 1045 HangOver Time Limit: 1 Sec... 阅读全文
posted @ 2010-02-22 19:05 Gavin Lipeng Ma 阅读(764) 评论(0) 推荐(0) 编辑
摘要:        刚开始用博客园,我是本着向大家学习,共享的精神来到这里的。在别人的博客里,经常看到一些代码,起初我也不知道这代码是怎么插入的,仔细看了一下博客园发布随笔的界面,才发现,原来是可以在这里这样插入的,但是我是一个Windows Live writer的用户,个人还是比较喜欢这个工具的,于是就开始寻找相关插件。不负我望,终于找到了... 阅读全文
posted @ 2010-02-22 15:51 Gavin Lipeng Ma 阅读(1251) 评论(0) 推荐(1) 编辑
摘要:       程序设计是编写代码的核心,一个算法的好坏,很大程度上会影响一个完整程序的运行效率。所以,多多进行程序设计的练习是很有必要的。程序设计的练习,利用Online judge这类平台再好不过了,我就就近取材了,直接到了浙大的Online judge来练练吧。不知道能解多少题,以后就都记录在这里好了,祝自己好运,嘿嘿。   ... 阅读全文
posted @ 2010-02-21 16:14 Gavin Lipeng Ma 阅读(411) 评论(2) 推荐(1) 编辑