摘要: 之前在解决一道算法题的时候,应用到set,特意对这个stl的容器类做了一些了解。在我的印象中,set就是一个元素不重复的集合,而事实上也正是这样的。无论从MSDN还是任何其它地方,都会告诉我们set的元素不可以重复。反之,只要元素不重复,就可以顺利的放入到set中。看起来这实在是再清楚不过了,但是仔细想一想的话,就会发现,话说只要不重复的元素就可以被放入到一个set中,但是什么样的元素是不重复的元... 阅读全文
posted @ 2012-03-13 22:03 Gavin Lipeng Ma 阅读(1768) 评论(0) 推荐(1) 编辑
摘要: Time Limit: 10 Seconds Memory Limit: 32768 KB For hundreds of years Fermat's Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n + c^n, has r... 阅读全文
posted @ 2012-03-13 17:19 Gavin Lipeng Ma 阅读(343) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 2 Seconds Memory Limit: 65536 KB A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night,... 阅读全文
posted @ 2012-03-13 13:03 Gavin Lipeng Ma 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 2 Seconds Memory Limit: 65536 KBGiven a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p.Example For n = 24, o = 3 and p = 3.Task Write a program which for each data set:reads a positive integer n, computes the odd integer o and the nonnegative in 阅读全文
posted @ 2012-03-13 10:18 Gavin Lipeng Ma 阅读(344) 评论(0) 推荐(0) 编辑