水哈希,将哈希值相同的映射放入一个槽内既可,哈希函数是对一个素数取余View Code #include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn = 4100;struct edge{ int v,next,num;}edge[3999972];int head[3999972];int hash(int num){ return (num+3899971)%3999971;}int tot;void add_edge(int num){ in Read More