上一页 1 2 3 4 5 6 7 8 9 10 ··· 26 下一页
摘要: There areNintegers in an arrayA. All but one integer occur in pairs. Your task is to find out the number that occurs only once.Input FormatThe first l... 阅读全文
posted @ 2014-08-14 11:51 SunshineAtNoon 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 题目链接:Running Time of QuicksortChallengeIn practice, how much faster is Quicksort (in-place) than Insertion Sort? Compare the running time of the two a... 阅读全文
posted @ 2014-08-13 13:25 SunshineAtNoon 阅读(863) 评论(0) 推荐(0) 编辑
摘要: Insertion Sort is a simple sorting technique which was covered in previous challenges. Sometimes, arrays may be too large for us to wait around for in... 阅读全文
posted @ 2014-08-12 16:37 SunshineAtNoon 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 题目连接:Sherlock and MiniMaxWatson gives Sherlock an arrayA1,A2...AN.He asks him to find an integerMbetweenPandQ(both inclusive), such that,min {|Ai-M|, ... 阅读全文
posted @ 2014-08-03 21:28 SunshineAtNoon 阅读(1165) 评论(0) 推荐(0) 编辑
摘要: 题目连接:Game Of RotationMark is an undergraduate student and he is interested in rotation. A conveyor belt competition is going on in the town which Mark... 阅读全文
posted @ 2014-08-02 22:24 SunshineAtNoon 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 有n组好朋友在公交车站前排队。第i组有ai个人。还有一辆公交车在路线上行驶。公交车的容量大小为x,即它可以同时运载x个人。 当车站来车时(车总是空载过来),一些组从会队头开始走向公交车。 当然,同一组的朋友不想分开,所以仅当公交车能容纳下整个组的时候,他们才会上车。另外,每个人不想失去自己的位置,即... 阅读全文
posted @ 2014-08-02 21:32 SunshineAtNoon 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 给你一个n*n的地图。地图中的每个格子有一个值表示该地区的深度。我们称一个地图中的一个格子为空洞,当且仅当该格子不在地图边缘并且每个和它相邻的格子都具有比它更小的深度。两个格子称为相邻如果它们共有一条边。你要找到地图中所有的空洞,并且用X描述。输入格式第一行包含一个整数n,表示地图的规模。 接下来n... 阅读全文
posted @ 2014-08-02 13:11 SunshineAtNoon 阅读(333) 评论(0) 推荐(0) 编辑
摘要: Watson gives an array A1,A2...AN to Sherlock. Then he asks him to find if there exists an element in the array, such that, the sum of elements on its ... 阅读全文
posted @ 2014-08-02 11:10 SunshineAtNoon 阅读(435) 评论(0) 推荐(0) 编辑
摘要: QuickSortIn the previous challenge, you wrote a partition method to split an array into 2 sub-arrays, one containing smaller elements and one containi... 阅读全文
posted @ 2014-08-02 09:49 SunshineAtNoon 阅读(1065) 评论(0) 推荐(0) 编辑
摘要: In this challenge you need to print the data that accompanies each integer in a list. In addition, if two strings have the same integers, you need to ... 阅读全文
posted @ 2014-08-01 19:38 SunshineAtNoon 阅读(1715) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 26 下一页