摘要: 布嵘过滤器为一种空间效率很高的随机数据结构, 它的实现方法主要包括一个位数组, 可用c++中的bitset来实现和k个哈希函数. 算法原理为: 当向某一个集合中添加一个元素的时候, 该元素会分别作为K个哈希函数的输入, 将该元素映射到位数组的k个点, 将这些点置为1. 当要查找某个元素是否在该集... 阅读全文
posted @ 2015-03-30 17:34 XYZ篮球 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 此题首先为利用筛选法求得10000以内的素数,然后对于输入的每一个数字,依次以小于它的连续素数相加,相等则种类数加一,返回,换另一个素数开始往后继续相加进行这个过程,最后输出种类数。1259. Sum of Consecutive PrimesConstraintsTime Limit: 1 sec... 阅读全文
posted @ 2014-12-08 20:09 XYZ篮球 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1240. Faulty OdometerConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionYou are given a car odometer which displays the miles traveled as an... 阅读全文
posted @ 2014-11-23 01:16 XYZ篮球 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1152. 简单的马周游问题ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB , Special JudgeDescription在一个5 * 6的棋盘中的某个位置有一只马,如果它走29步正好经过除起点外的其他位置各一次,这样一种走法则称马的周游路... 阅读全文
posted @ 2014-10-15 13:25 XYZ篮球 阅读(482) 评论(0) 推荐(0) 编辑
摘要: 1050. Numbers & LettersConstraintsTime Limit: 3 secs, Memory Limit: 32 MBDescriptionIn the early 80’s, a popular TV show on Dutch television was ‘Cijf... 阅读全文
posted @ 2014-10-06 11:46 XYZ篮球 阅读(287) 评论(0) 推荐(0) 编辑
摘要: DescriptionThere are N cities and N-1 roads in Magic-Island. You can go from one city to any other. One road only connects two cities. One day, The ki... 阅读全文
posted @ 2014-10-06 00:46 XYZ篮球 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 1156. Binary treeConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionYour task is very simple: Given a binary tree, every node of which conta... 阅读全文
posted @ 2014-10-04 01:06 XYZ篮球 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 1443. Printer QueueConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionThe only printer in the computer science students' union is experienci... 阅读全文
posted @ 2014-10-04 00:20 XYZ篮球 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 1006. Team RankingsConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionIt's preseason and the local newspaper wants to publish a preseason ra... 阅读全文
posted @ 2014-10-03 20:17 XYZ篮球 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 1036. Crypto ColumnsConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionThe columnar encryption scheme scrambles the letters in a message (or... 阅读全文
posted @ 2014-10-03 16:54 XYZ篮球 阅读(236) 评论(0) 推荐(0) 编辑