完全顶替map

#define Size 114514
struct Hash_map
{
	int head[Size+10],nxt[N],tot;
	long long to[N];int val[N];
	int hash(int x)
	{
		if(x<0) return (-x)%Size;
		return x%Size; 
	} 
	int& operator[](int x)
	{
		int u=hash(x);
		for(int i=head[u];~i;i=nxt[i])
		{
			if(to[i]==x) return val[i];
		}
		nxt[++tot]=head[u];
		head[u]=tot;to[tot]=x;
		return val[tot]=0;
	}
	void clear()
	{
		tot=-1;
		memset(head,-1,sizeof(head));
	}
	Hash_map()
	{
		tot=-1;
		memset(head,-1,sizeof(head));
	}
};