zoukankan      html  css  js  c++  java
  • 其他-手工哈希映射

    struct ghs {
    private:
    	static const int A = 999917, B = 1e7;
    	ll v[B];
    	int fst[A], nxt[B], w[B], s[B], top, cnt;
    	
    	int ins(int x, ll y)
    	{
    		if (!fst[x]) s[++top] = x;
    		nxt[++cnt] = fst[x], fst[x] = cnt;
    		v[cnt] = y;
    		return w[cnt] = 0;
    	}
    	
    	void clear()
    	{
    		cnt = 0;
    		while (top)
    			fst[s[top--]] = 0;
    		return;
    	}
    
    public:
    	int &operator [] (ll x)
    	const
    	{
    		int t = x % A;
    		for (int i = fst[t]; i; i = nxt[i])
    			if (v[i] == x) return w[x];
    		return ins(t, x);
    	}
    };
    

    Really don't like that Old–fashioned 'au' sound, and the tune is bit of weird i think (as if she's choking). And btw, officially no British dialects have the glotal T sound (like wa'er) except for Cockney, which is far away from modern RP and considered unstandard. You speak with modern RP to show your intelligence and how well you have been educated, of course. But i just can't stop associating this with an old weather forecaster...

  • 相关阅读:
    pip 笔记
    Codeforces Round #739
    leetcode周赛 248
    AcWing周赛 6
    AcWing周赛 5
    算法提高--最长上升子序列一
    算法提高--数字三角形模型
    数据结构--线段树
    leetcode周赛 243
    AcWing周赛 1
  • 原文地址:https://www.cnblogs.com/ghcred/p/9839786.html
Copyright © 2011-2022 走看看