It should not pass the compiled Hash board correctly

The number of membranes can be changed. .

const int MOD=72227 or 66666 or 997,Q=???;
int las[MOD],v[Q],nn[Q],be[Q],inc;
void _init()
{
    memset(las,0,sizeof(las));
    inc=0;
}
int _find(int k)
{
    int x=k%MOD;
    for(int t=las[x];t;t=nn[t])
        if(be[t]==k)return v[t];
    return -1;
}
void ins(int k,int w)
{
    int x=k%MOD;
    for(int t=las[x];t;t=nn[t])
        if(be[t]==k){
            v[t]=w;
            return;
        }
    v[++inc]=w;
    be[inc]=k;
    nn[inc]=las[x];
    las[x]=inc;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325651331&siteId=291194637