哈希表与stl集合
文章平均质量分 65
yan_____
不跟你介绍
展开
-
uva 141 The Spot Game
#include #include #include #define max 55 int n; using namespace std; struct state{ int State[max][max]; friend bool operator { int i,j; for(i=1;i for( j=1;j if(a.State[i][j] return tru原创 2012-10-16 16:39:49 · 540 阅读 · 0 评论 -
uva 10391复合词 字符串哈希
head的下标是哈希值,head[哈希值]=字符串的下标,拉链处理矛盾 要注意字符串哈希值的取法 #include #include char st[121000][30],temp[30]; int head[10000019],next[121000]; int hash(char *str) { int seed=31,v=0; while(*str) {原创 2013-04-16 10:47:18 · 769 阅读 · 0 评论