摘要: In the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon 阅读全文
posted @ 2017-01-21 15:31 DGSX 阅读(152) 评论(0) 推荐(0) 编辑
摘要: On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 label 阅读全文
posted @ 2017-01-21 12:41 DGSX 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a 阅读全文
posted @ 2017-01-20 23:11 DGSX 阅读(172) 评论(0) 推荐(0) 编辑
摘要: The factorial function, n! is defined thus for n a non-negative integer: 0! = 1 n! = n * (n-1)! (n > 0) We say that a divides b if there exists an int 阅读全文
posted @ 2017-01-20 14:54 DGSX 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 以前求素数总是用一堆数去试除,模有0就不是素数,这样做的实在费劲。 在看别人的代码时发现一个比较优雅的方法。用空间换时间,有些时候是很可行的。 求50000内的素数: 阅读全文
posted @ 2017-01-20 13:01 DGSX 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Roman roads are famous for their longevity and sound engineering. Unfortunately, sound engineering does not come cheap, and a number of neo-Caesars ha 阅读全文
posted @ 2017-01-19 15:50 DGSX 阅读(155) 评论(0) 推荐(0) 编辑
摘要: One of the central idea behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 dig 阅读全文
posted @ 2017-01-19 12:37 DGSX 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Suppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positiv 阅读全文
posted @ 2017-01-19 12:14 DGSX 阅读(156) 评论(0) 推荐(0) 编辑
摘要: BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical commun 阅读全文
posted @ 2017-01-19 11:26 DGSX 阅读(165) 评论(0) 推荐(0) 编辑
摘要: A crossword can be stored as a matrix m x n of zeros and ones. Zero represents white squares and one represents black squares. Some squares of the cro 阅读全文
posted @ 2017-01-18 19:18 DGSX 阅读(212) 评论(0) 推荐(0) 编辑