#include#include#include#includeusing namespace std;int n,m;#define N 32#define mod 10007LL#define mod2 10000007#define inf 0x3ffffffftypedef long lon...
分类:
其他好文 时间:
2014-07-09 21:48:32
阅读次数:
358
1. [文件] webtoolkit.sha1.js ~ 4KB /**** Secure Hash Algorithm (SHA1)* http://www.huiyi8.com/css3/***/function SHA1 (msg) {function rotate_left(n,s) {v....
分类:
编程语言 时间:
2014-07-09 00:46:00
阅读次数:
343
匈牙利算法模板题有n门课程,每门课程可能有不同一时候间,不同一时候间的课程等价。问不冲突的情况下最多能选多少门课。建立二分图,一边顶点表示不同课程,还有一边表示课程的时间(hash一下)。#include #include #include #include #include #include #i...
分类:
其他好文 时间:
2014-07-08 23:05:36
阅读次数:
291
add by zhj:介绍了什么是一致性hash,以及实现一致性hash的一种算法。原文:http://my.oschina.net/u/195065/blog/193614 目录[-]一致性hash算法(consistent hashing)1基本场景2 hash算法和单调性3 consisten...
分类:
其他好文 时间:
2014-07-06 14:30:16
阅读次数:
194
今天在Ubuntu下写一个程序的时候用到了hash_set容器,出现一点问题,在这里记录一下,先说一下,hash_*系列例如hash_map,hash_set 等已经被废弃了,C++11用unordered_map,unordered_set等来替代,但是我用的g++ 4.6.1警告说C++11特性是实验性的,貌似到4.8才完全支持。所以就改用hash_set了,写了如下的程序:
#includ...
分类:
其他好文 时间:
2014-07-06 12:47:24
阅读次数:
209
第一个只出现一次的字符 代码(C)本文地址: http://blog.csdn.net/caroline_wendy题目: 在字符串中找出第一个只出现一次的字符.字符是char类型, 所以匹配256种可能, 采用hash表, 计算出现的次数, 再找到第一次出现的字符.代码:/*
* main.cpp
*
* Created on: 2014.6.12
* Author: Spi...
分类:
其他好文 时间:
2014-07-04 07:50:21
阅读次数:
174
Python 对Twitter tweet的元素 (Word, Screen Name, Hash Tag)的词汇多样性分析...
分类:
编程语言 时间:
2014-07-03 18:48:39
阅读次数:
222
VS关于hash_map使用的一些常用构造方法汇总,包括基本类型和结构体,相信够一般模仿使用:
# include
#include
#include
struct order
{
char orderNO[20];
char name[10];
int NO;
char type;
};
typedef order Order;
struct cmp{
enum
{...
分类:
其他好文 时间:
2014-07-03 15:39:22
阅读次数:
254
在solrcloud出来之前,如果通过solrj连接solrserver,需要程序自己实现一致性hash.新版本的solr支持cloud的部署方式,可以自动实现lb和sharding的功能(通过CloudSolrServer类连接cloud),可以用下面代码做测试需要的jar包如下:apache-solr-solrj.jar
apache-solr-core.jar
z..
分类:
其他好文 时间:
2014-07-03 14:36:31
阅读次数:
199