摘要: HerdingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 937 Accepted Submission(s): 254 Problem DescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omi 阅读全文
posted @ 2013-09-10 23:08 龚细军 阅读(308) 评论(0) 推荐(0)
摘要: Rotation Lock PuzzleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 695 Accepted Submission(s): 204 Problem DescriptionAlice was felling into a cave. She found a strange door with a number square matrix. These numbers can be rotated around the ce 阅读全文
posted @ 2013-09-10 21:05 龚细军 阅读(366) 评论(1) 推荐(0)
摘要: 如何测试洗牌程序 我希望本文有助于你了解测试软件是一件很重要也是一件不简单的事。我们有一个程序,叫ShuffleArray(),是用来洗牌的,我见过N多千变万化的ShuffleArray(),但是似乎从来没人去想过怎么去测试这个算法。所以,我在面试中我经常会问应聘者如何测试ShuffleArray(),没想到这个问题居然难倒了很多有多年编程经验的人。对于这类的问题,其实,测试程序可能比算法更难写,代码更多。而这个问题正好可以加强一下我在《我们需要专职的QA吗?》中我所推崇的——开发人员更适合做测试的观点。我们先来看几个算法(第一个用递归二分随机抽牌,第二个比较偷机取巧,第三个比较通俗易懂)递归 阅读全文
posted @ 2013-09-10 13:39 龚细军 阅读(471) 评论(0) 推荐(0)
摘要: Hamming DistanceTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 916Accepted Submission(s): 335 Problem Description(From wikipedia) For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. For calculating Hamming d 阅读全文
posted @ 2013-09-10 13:28 龚细军 阅读(285) 评论(0) 推荐(0)