码迷,mamicode.com
首页 > 其他好文 > 详细

双重 hash

时间:2018-07-27 21:10:39      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:algorithm   space   name   ace   nbsp   clu   mes   hash   first   

#include<stdio.h>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
typedef long long ll;
pair<ll,ll>pp;
pair<ll,ll> Hash(ll a[21])
{
	ll ans1=0,ans2=0;
	for(ll i=0;i<21;i++)
		ans1=(ans1*1000000013+a[i])%1000000007;
	for(ll i=0;i<21;i++)
		ans2=(ans2*1000000013+a[i])%1000000009;
	pp.first=ans1;
	pp.second=ans2;
	return pp;
}

 

双重 hash

标签:algorithm   space   name   ace   nbsp   clu   mes   hash   first   

原文地址:https://www.cnblogs.com/ccut-ry/p/9379235.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!