随笔分类 -  算法相关

摘要:简单的算法题, Find Minimum in Rotated Sorted Array 的Python实现。题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6... 阅读全文
posted @ 2014-11-05 13:45 天如er 阅读(206) 评论(0) 推荐(0)
摘要:Topcoder上的一道题目,题目描述如下:Problem StatementByteland is a city with many skyscrapers, so it's a perfect venue for BASE jumping. Danilo is an enthusiastic B... 阅读全文
posted @ 2014-08-14 18:23 天如er 阅读(688) 评论(0) 推荐(0)
摘要:题目:http://acm.hrbeu.edu.cn/index.php?act=problem&id=1005&cid=18Description大家都玩过连连看吧!今天我们玩一个类似的游戏。在一个由10*10个小方格组成的矩形里有n(n#include #include #include #in... 阅读全文
posted @ 2012-04-16 20:52 天如er 阅读(403) 评论(0) 推荐(0)
摘要:题目(Topcoder锦标赛187 250题):Problem Statement +---+ | D |+---+---+---+---+| E | A | B | F |+---+---+---+---+ | C | +---+The ASCII art above sh... 阅读全文
posted @ 2012-01-27 15:53 天如er 阅读(356) 评论(0) 推荐(0)
摘要:题目:Consider an infinite square grid. Each square in the grid can be represented by a pair of integer coordinates that specify its row and column.We wi... 阅读全文
posted @ 2012-01-20 22:12 天如er 阅读(409) 评论(0) 推荐(0)
摘要:题目:Problem StatementYou are given a bidirectional cyclical queue which contains N elements. You need to extract several elements from this queue. You ... 阅读全文
posted @ 2012-01-18 21:15 天如er 阅读(351) 评论(0) 推荐(0)
摘要:题目:In the attic of your house you found an M×N board, divided into MN unit squares. Some of the squares are black and the others are white. You decide... 阅读全文
posted @ 2012-01-15 23:52 天如er 阅读(506) 评论(0) 推荐(0)