Demo entry 6714706

123

   

Submitted by anonymous on Feb 15, 2018 at 10:39
Language: C++. Code size: 142 Bytes.

int work(char *s,int n,int base,int p)
{
    long long ans=0;
    for(int i=1;i<=n;i++)
        ans=(ans*base+s[i])%p;
    return ans;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).